Digital Signature

Computational components for signing any objects

hash[ ], ⌗[ ], ⌗@


A hash code is a fixed-size numerical value generated from input data of arbitrary size, used primarily for indexing data in hash tables. It allows for efficient data retrieval and storage by mapping variable-length data to a fixed-length representation.

Think of the hash code as a unique digital signature for any data that once even if one bit of that data altered the entire new hash code would be different.

Example: "dara is good lookin" has the hash code:

"0x05ee501e3232083ca0f16b02011944e735f78db170c568c2ea85e56380ddca05"

Counterexample: "dara is good lookin." the ending red dot cause an entire change to the has code above:

"0x4700eceb9e5cbc887ad3dea1833081d51c3572c7886ea9c8a3f30b0c5ad4c614"

hash1 = ⌗["dara is good lookin"];
hash2 = ⌗@"dara is good lookin";
hash3 = hash["dara is good looking"];

show hash1 also hash2 also hash3;

save as myhash;

Output

hash1⟶("0x05ee501e3232083ca0f16b02011944e735f78db170c568c2ea85e56380ddca05")

hash2⟶("0x05ee501e3232083ca0f16b02011944e735f78db170c568c2ea85e56380ddca05")

hash3⟶("0x4700eceb9e5cbc887ad3dea1833081d51c3572c7886ea9c8a3f30b0c5ad4c614")





Digital Signature

Sign
🔐["rsa"];

message = "hi";

signature = 🗝🫆message;

save as signature1;
Cloud Object Browser: signature1
Verify Signature

Paths starting with / are external paths e.g. "/certs/free/signature1" created by other programs and networks , while paths like "base/signature/value" are local to the current Free Form language script.

base = "/certs/free/signature1";

s = "base/signature/value";

key = "base/🔑";

message = "hi";

q = (✍🏻 s ⚲ message)🫆key;

show q;

save as verify1;

Output:

"q" ⟶ True

Cloud Object Browser: verify1
FAIL: Verify Signature
base = "/certs/free/signature1";

s = "base/signature/value";

key = "base/🔑";

message = "hi!";

q = ( ✍🏻 s ⚲ message  ) 🫆key;

show q;

save as verify1-2;

Output:

"q" ⟶ False

Cloud Object Browser: verify1-2