Vigenère cipher: Difference between revisions
Content deleted Content added
Cyril Nocton (talk | contribs) |
Cyril Nocton (talk | contribs) |
||
Line 960: | Line 960: | ||
(let ((text (strip text)) (key (strip key)) (i -1)) |
(let ((text (strip text)) (key (strip key)) (i -1)) |
||
(map 'string |
(map 'string |
||
(lambda ( |
(lambda (c) |
||
(setf i (mod (1+ i) (length key))) |
(setf i (mod (1+ i) (length key))) |
||
(char +a+ (mod (+ (position |
(char +a+ (mod (+ (position c +a+) (* d (position (elt key i) +a+))) 26))) |
||
text)))</lang> |
text)))</lang> |
||
2. Execution |
2. Execution |
||
⚫ | |||
<pre>(vigenere "« Through the Looking-Glass »" "Lewis Carroll") |
<pre>(vigenere "« Through the Looking-Glass »" "Lewis Carroll") |
||
⚫ | |||
⚫ | |||
<pre> |
|||
"ELNWMIHKYSWZZOEVYILRJG" |
"ELNWMIHKYSWZZOEVYILRJG" |
||
⚫ | |||
"THROUGHTHELOOKINGGLASS"</pre> |
"THROUGHTHELOOKINGGLASS"</pre> |
||