Add binary signatures #8

Merged
zxq9 merged 4 commits from bin_sig into master 2025-11-01 11:30:27 +09:00
Owner

Adding binary signatures with a predetermined salt.

Adding binary signatures with a predetermined salt.
zxq9 added 1 commit 2025-10-25 12:34:23 +09:00
Author
Owner
1> {GoodPK, GoodKey} = hz_key_master:make_key(<<>>).
{<<"ak_gsF8KKM8KKZLhEUZwzG4SCRf4sayCUKWzmDU5jGq8FhR3PVx9">>,
 #{public =>
       <<90,133,111,232,193,82,157,216,103,10,188,69,250,82,188,
         199,145,85,227,128,150,242,173,186,49,255,...>>,
   secret =>
       <<243,107,117,61,13,53,113,153,92,170,137,118,167,2,200,
         117,235,48,254,2,152,238,11,140,158,233,...>>}}
2> {BadPK, BadKey} = hz_key_master:make_key(<<>>).
{<<"ak_27rqLUsbMovDe3DdvZWZNVir7TRgjqBbwhHf2ag582FYm7i5NQ">>,
 #{public =>
       <<147,69,79,43,169,51,26,229,196,11,150,138,5,126,68,238,
         10,147,25,139,133,59,14,90,43,79,...>>,
   secret =>
       <<163,171,4,215,187,31,91,231,108,204,112,57,254,203,
         212,217,115,115,102,76,248,167,139,210,221,191,...>>}}
3> Binary = <<"OMG! I am a message that will be tossed into the void forever and ever after being all mixed around and smushed up in a hash algo oh no!!!">>.
<<"OMG! I am a message that will be tossed into the void forever and ever after being all mixed around and smushed up i"...>>
4> Sig = base64:encode(hz:sign_binary(Binary, maps:get(secret, GoodKey))).
<<"DtkFQ21fcD2jv8rt05l+PYWsp8eyT3/1zzJy3XS301ia6wox0OOddlffJ2DVHckKTu6tw4pryq5qE5Fyv1BODw==">>
5> hz:verify_bin_signature(Sig, Binary, GoodPK).
{ok,true}
6> hz:verify_bin_signature(Sig, Binary, BadPK).
{ok,false}
``` 1> {GoodPK, GoodKey} = hz_key_master:make_key(<<>>). {<<"ak_gsF8KKM8KKZLhEUZwzG4SCRf4sayCUKWzmDU5jGq8FhR3PVx9">>, #{public => <<90,133,111,232,193,82,157,216,103,10,188,69,250,82,188, 199,145,85,227,128,150,242,173,186,49,255,...>>, secret => <<243,107,117,61,13,53,113,153,92,170,137,118,167,2,200, 117,235,48,254,2,152,238,11,140,158,233,...>>}} 2> {BadPK, BadKey} = hz_key_master:make_key(<<>>). {<<"ak_27rqLUsbMovDe3DdvZWZNVir7TRgjqBbwhHf2ag582FYm7i5NQ">>, #{public => <<147,69,79,43,169,51,26,229,196,11,150,138,5,126,68,238, 10,147,25,139,133,59,14,90,43,79,...>>, secret => <<163,171,4,215,187,31,91,231,108,204,112,57,254,203, 212,217,115,115,102,76,248,167,139,210,221,191,...>>}} 3> Binary = <<"OMG! I am a message that will be tossed into the void forever and ever after being all mixed around and smushed up in a hash algo oh no!!!">>. <<"OMG! I am a message that will be tossed into the void forever and ever after being all mixed around and smushed up i"...>> 4> Sig = base64:encode(hz:sign_binary(Binary, maps:get(secret, GoodKey))). <<"DtkFQ21fcD2jv8rt05l+PYWsp8eyT3/1zzJy3XS301ia6wox0OOddlffJ2DVHckKTu6tw4pryq5qE5Fyv1BODw==">> 5> hz:verify_bin_signature(Sig, Binary, GoodPK). {ok,true} 6> hz:verify_bin_signature(Sig, Binary, BadPK). {ok,false} ```
zxq9 requested review from dimitar.p.ivanov 2025-10-25 12:38:16 +09:00
zxq9 requested review from hans_sv 2025-10-25 12:38:17 +09:00
zxq9 requested review from pharpend 2025-10-25 12:38:18 +09:00
zxq9 requested review from spivee 2025-10-25 12:38:19 +09:00
zxq9 requested review from uwiger 2025-10-25 12:38:20 +09:00
zxq9 added 1 commit 2025-10-25 12:41:33 +09:00
zxq9 added 1 commit 2025-10-25 12:49:01 +09:00
zxq9 added 1 commit 2025-10-29 15:53:58 +09:00
zxq9 merged commit c713053efd into master 2025-11-01 11:30:27 +09:00
zxq9 deleted branch bin_sig 2025-11-01 11:30:27 +09:00
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/hakuzaru#8
No description provided.