Algosim documentation: VigenèreEncode

VigenèreEncode

Encodes a text using the Vigenère cipher.

Syntax

Description

If s is a string to be encoded and w a Vigenère password, a string containing only A..Z letters, then VigenèreEncode(s, w) returns s encoding using password w.

Examples

Alice ≔ ExampleData("Alice in Wonderland")
ALICE’S ADVENTURES IN WONDERLAND

Lewis Carroll

THE MILLENNIUM FULCRUM EDITION 3.0




CHAPTER I. Down the Rabbit-Hole

Alice was beginning to get very tired of sitting by her sister on the
bank, and of having nothing to do: once or twice she had peeped into the
book her sister was reading, but it had no pictures or conversations in
it, ‘and what is the use of a book,’ thought Alice ‘without pictures or
conversations?’

So she was considering in her own mind (as well as she could, for the
hot day made her feel very sleepy and stupid), whether the pleasure
of making a daisy-chain would be worth the trouble of getting up and
picking the daisies, when suddenly a White Rabbit with pink eyes ran
close by her.

There was nothing so VERY remarkable in that; nor did Alice think it so
VERY much out of the way to hear the Rabbit say to itself, ‘Oh dear!
Oh dear! I shall be late!’ (when she thought it over afterwards, it
occurred to her that she ought to have wondered a…
VigenèreEncode(Alice, "MarvellousOpiliones")
MLZXI’D UVJTVECFRW UN RSYOSLDOCL

Pwiij Glcfidz

HUI YICGIYYWOE UCWKFHQ QDZOMZY 3.0




TCEAESL W. Owka lte Memmwn-Vdtp

Sxitz hlg tsvqyvwak fo bie jyjm btzsq gr jdxetba pn smf waetvm zy nzs
mibx, mnu sq vunwco vcglazg os oc: cckp ce liitz dss zos amsciv ieos evy
qwzs uij sznxpc qsg zpirvry, spx th zos yw cmufuizw zf uccdpzgnxaanj my
cl, ‘lvr azmt dw evy ihm wt e noff,’ hbgivpe Oymuq ‘rmescol eqnbieik oi
nzbpwfhieqcaw?’

Dz mzs ela psfeiuzvtyu ab ppz baf mzih (om kttw of kte xsfwr, tdz bvr
tok hlj gsrt smf jwql qicj mdstxj oah etlkmo), ovtbsmf xzq ggildilw
wq anoazg v olwmq-rplqb agglu fp kijhw eps xjausgi zt ysibtvu yh aey
awwcwco bvr vmijdid, qzsc dcrqifxy v Hswnw Gimjwg outy ttyy wmta zoa
olfni mm zsg.

Xzqrv ald hghwqyo fs HEIT cpaujypjwm vr fhro; ycl rxl Izvgw tydrv wn gd
DSEC yutc zfh gt bsm jeq tf lplf lvt Cipoml srt ez clgttq, ‘Sz dvvv!
Iz smlz! M ehrgp ms doim!’ (azqn nlp hbgivpe wg ghei eqesloogld, vx
otxyccsx hd smf xzmt nlp coyvi ew uenq njropfyv p…

See also