Asymmetic Keys
Two keys one public and one private.
- π
- π: Public Key
- π: Private Key
- Encrypt: ππ
- Decrypt: π π
- Cipherπis non-commutative
- ?
π
π 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: ππ
- Symbol πbehaves like a binary operator
- π encrypts what is on its rhs e.g. πm
- ππuses the key on its lhs to encrypt
- crypt = ππ m just like e.g. multiplication copies the resultant into the lhs of =
ππ 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.
?
- 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.