Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Vigen-re-cipher/Smalltalk/vigen-re-cipher-1.st
Normal file
3
Task/Vigen-re-cipher/Smalltalk/vigen-re-cipher-1.st
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
prep := [:s | s select:[:ch | ch isLetter] thenCollect:[:ch | ch asUppercase]].
|
||||
encrypt := [:s :cypher | (prep value:s) keysAndValuesCollect:[:i :ch | ch rot:((cypher at:((i-1)\\key size+1))-$A) ]].
|
||||
decrypt := [:s :cypher | (prep value:s) keysAndValuesCollect:[:i :ch | ch rot:26-((cypher at:((i-1)\\key size+1))-$A) ]].
|
||||
7
Task/Vigen-re-cipher/Smalltalk/vigen-re-cipher-2.st
Normal file
7
Task/Vigen-re-cipher/Smalltalk/vigen-re-cipher-2.st
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
plain := 'Beware the Jabberwock, my son! The jaws that bite, the claws that catch!'.
|
||||
cypher := 'VIGENERECIPHER'.
|
||||
crypted := encrypt value:plain value:cypher.
|
||||
plain2 := decrypt value:crypted value:cypher.
|
||||
|
||||
crypted -> 'WMCEEIKLGRPIFVMEUGXQPWQVIOIAVEYXUEKFKBTALVXTGAFXYEVKPAGY'
|
||||
plain2 -> 'BEWARETHEJABBERWOCKMYSONTHEJAWSTHATBITETHECLAWSTHATCATCH'
|
||||
Loading…
Add table
Add a link
Reference in a new issue