Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Substitution-cipher/Zkl/substitution-cipher-1.zkl
Normal file
7
Task/Substitution-cipher/Zkl/substitution-cipher-1.zkl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
class SubstitutionCipher{
|
||||
// 92 characters: " !"#$%&" ... "xyz{|}", doesn't include "~"
|
||||
const KEY="]kYV}(!7P$n5_0i R:?jOWtF/=-pe'AD&@r6%ZXs\"v*N"
|
||||
"[#wSl9zq2^+g;LoB`aGh{3.HIu4fbK)mU8|dMET><,Qc\\C1yxJ";
|
||||
fcn encode(s){ s.apply(fcn(c){ try{ KEY[c.toAsc()-32] }catch{ c } }) }
|
||||
fcn decode(s){ s.apply(fcn(c){ try{ (KEY.index(c)+32).toChar() }catch{ c } }) }
|
||||
}
|
||||
11
Task/Substitution-cipher/Zkl/substitution-cipher-2.zkl
Normal file
11
Task/Substitution-cipher/Zkl/substitution-cipher-2.zkl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
text:="Here we have to do is there will be a input/source "
|
||||
"file in which we are going to Encrypt the file by replacing every "
|
||||
"upper/lower case alphabets of the source file with another "
|
||||
"predetermined upper/lower case alphabets or symbols and save "
|
||||
"it into another output/encrypted file and then again convert "
|
||||
"that output/encrypted file into original/decrypted file. This "
|
||||
"type of Encryption/Decryption scheme is often called a "
|
||||
"Substitution Cipher.";
|
||||
encoded:=SubstitutionCipher.encode(text);
|
||||
println( "Encoded: ",encoded);
|
||||
println("\nDecoded: ",SubstitutionCipher.decode(encoded));
|
||||
Loading…
Add table
Add a link
Reference in a new issue