Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Substitution-cipher/Pike/substitution-cipher.pike
Normal file
11
Task/Substitution-cipher/Pike/substitution-cipher.pike
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
string key = "VsciBjedgrzyHalvXZKtUPumGfIwJxqOCFRApnDhQWobLkESYMTN";
|
||||
mapping key_mapping = mkmapping(alphabet/1, key/1);
|
||||
object c = Crypto.Substitution()->set_key(key_mapping);
|
||||
|
||||
string msg = "The quick brown fox jumped over the lazy dogs";
|
||||
string msg_enc = c->encrypt(msg);
|
||||
string msg_dec = c->decrypt(msg_enc);
|
||||
|
||||
write("Encrypted: %s\n", msg_enc);
|
||||
write("Decrypted: %s\n", msg_dec);
|
||||
Loading…
Add table
Add a link
Reference in a new issue