Asymmetic Keys

Two keys one public and one private.

πŸ”

πŸ” is a mighty operator, function and a cloud data source all at once!

As an operator or function it is used with no arguments and it creates the Free Form Programming Language's (ff) default blockchain whic is currently set to Bloxberg 2.0.

In the ff script below you can see on the first line πŸ” acts as singleton operator or function and , and on the 3rd line as a cloud data source:

πŸ”;

show πŸ”;

save as blox;

Output

"πŸ”" β†’ {"type" -> "\"elliptic\"", "curve" -> "\"ethereum\"", "compressed" -> "False"}


πŸ”;

tmp = "πŸ”/curve";

show tmp;

save as blox;


Output

"tmp" β†’ ethereum

πŸ”‘: Public Key

πŸ—: Private Key

Encrypt: πŸ”‘πŸ”’

πŸ”‘πŸ”’ m behaves like a product by the operator πŸ”’incorporating is rhs and lhs into a product.

πŸ” ["rsa"] ; 

m = "hi";

crypt = πŸ”‘πŸ”’ m;

show crypt;

save as rsa;

Output:

"crypt" ⟢ "<|

\"Cipher\" -> \"RSA\",

\"Data\" -> ByteArray[\"UK0fWzfMEKdQ+aQnc5a3BX0C7ptg4aEa5mbXQhIRz+/17WVRIQ+atsjSET8Rin7BsIPaTW851pky8dbTLNNg8vja0mI572KZJXRM9YGaFte2UkqwGl4OSEdmv+fXD7KbVi0Ps/uO/EskrksneIPSCnIMaJ8VkSRjcNsXjuAoPvJ92mwvvfSSdMNxm0FJjuCMSgGZRfwwEK0XWviKcmV4eljBv2m9NT4Rk1e130EXovnqtGS5XNyGzDQew8fHtgRreeTmSwOO7HCfrqmzYH14aBTRf+KuLLcaPpKo98PGeCmnDW56CpDWHsnYsOtkq/oY/9ACHwPk9hR5Hfl9O2l2Yg==\"],

\"OriginalForm\" -> String,

\"Padding\" -> \"PKCS1\"

|>"

Decrypt: πŸ”’ πŸ—

πŸ” ["rsa"] ; 

bob = "hi";

crypt  = πŸ”‘πŸ”’ bob;

alice = crypt πŸ”’ πŸ—;

show bob also alice;

save as rsa;

Output:

"bob" ⟢ "(\"hi\")"

"alice" ⟢ "(\"hi\")"

CipherπŸ”’is non-commutative

πŸ”‘πŸ”’ encrypts while πŸ”’πŸ”‘ decrypts!

πŸ”’is called Cipher.

CipherπŸ”’acts like a binary operator.

?

  1. No matter , if the key on the left of the cipher πŸ”’ is public and the right side only the private key, how about a single key κ„— symbol which is replaced according to its corresponding location relative to πŸ”’. y = κ„— πŸ”’x encrypts x into y and x = yπŸ”’κ„— decrypts y back to x. If the cipher πŸ”’has asymmetric keys this works fine, and symmetric key ciphers by definition fits.