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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adding binary signatures with a predetermined salt.