cm.set_key("yzabchijkdeflmntuvwxopqrsg")
plaintext = "I don't love non-alphabet characters. I will remove all of them: ^,&@$~(*;?&#. Great!"
encdec(cm, plaintext)

cm = Block(cm, length=5, sep=")(")
plaintext = "This text is divided by blocks of length 5!"
encdec(cm, plaintext)

cm = SaveAll(cm0)
plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
encdec(cm, plaintext)

cm.set_alphabet(al.ENGLISH_SQUARE_IJ)
key = ("n", "g", "a", "b", "l", "s", "t", "u", "v", "c", "m", "o", "p", "q",
       "h", "ij", "k", "w", "x", "y", "r", "d", "e", "f", "z")
cm.set_key(key)
plaintext = "Jj becomes Ii because we use ENGLISH_SQUARE_IJ!"
encdec(cm, plaintext)

alphabet = u"abcdABCDEfghijFGHIJ"
key = u"dABDFIJEfgCHabchijG"
cm.set_alphabet(alphabet)
cm.set_key(key)
plaintext = u"Text aBcdHijf"
encdec(cm, plaintext)
'''
schweißgequältvomödentextzürnttypografjakob
qxßuäüzeänsobrtlciyägrävrjkpgrrhmlepfödfalw
schweißgequältvomödentextzürnttypografjakob
--------------------------------------------------------------------
I don't love non-alphabet characters. I will remove all of them: ^,&@$~(*;?&#. Great!
Exemple #2
0
encdec(cm, plaintext)

cm = Block(cm, length=5, sep="-")
plaintext = "This text is divided by blocks of length 5!"
encdec(cm, plaintext)

cm = SaveAll(cm0)
plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
encdec(cm, plaintext)

cm.set_alphabet(al.ENGLISH_SQUARE_IJ)
plaintext = "Jj becomes Ii because we use ENGLISH_SQUARE_IJ!"
encdec(cm, plaintext)

cm.set_alphabet(al.JAPANESE_HIRAGANA)
cm.set_key(u"かぎ")
plaintext = u"text いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす !"
encdec(cm, plaintext)

cm = UpperCase(cm)
alphabet = al.GREEK
cm.set_alphabet(alphabet)
cm.set_key(u"κλειδί")
plaintext = u"Θέλει αρετή και τόλμη η ελευθερία. (Ανδρέας Κάλβος)"
encdec(cm, plaintext)
'''
schweißgequältvomödentextzürnttypografjakob
geodcärkpewdwrjcqivguaclhßjfpäawdcküshqlict
schweißgequältvomödentextzürnttypografjakob
--------------------------------------------------------------------
I don't love non-alphabet characters. I will remove all of them: ^,&@$~(*;?&#. Great!
Exemple #3
0
cm = cm0
cm.set_alphabet(al.ENGLISH)
plaintext = "I don't love non-alphabet characters and uppercase. I will remove all of them: ^,&@$~(*;?&#."
encdec(cm, plaintext)

cm = Block(cm, length=5, sep=" ")
plaintext = "This text is divided by blocks of length 5!"
encdec(cm, plaintext)

cm = SaveAll(cm0)
plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
encdec(cm, plaintext)

cm.set_alphabet(al.JAPANESE_HIRAGANA)
cm.set_key(u"だやぎへ")
plaintext = u"text あい だやぎへぐゆぢ"
encdec(cm, plaintext)

cm.set_alphabet(al.ENGLISH_SQUARE_IJ)
cm.set_key(u"keyj")
plaintext = "ENGLISH_SQUARE_IJ doesn't change Ii to Jj because it's a transposition cipher!"
encdec(cm, plaintext)
'''
schweißgequältvomödentextzürnttypografjakob
cuenfgmzghäntjwlttaeöürsqdraivxpoßotobeteyk
schweißgequältvomödentextzürnttypografjakob
================================================================================
I don't love non-alphabet characters and uppercase. I will remove all of them: ^,&@$~(*;?&#.
dnbcuemfllhsrlamtacreieeieaadseoooetpiotvhrnarlnntepwvhopaacll
idontlovenonalphabetcharactersanduppercaseiwillremoveallofthem
cm = cm0
cm.set_alphabet(al.ENGLISH)
cm.set_key("tomatokey")
plaintext = "I don't love non-alphabet characters. I will remove all of them: ^,&@$~(*;?&#. Great!"
encdec(cm, plaintext)

cm = Block(cm, length=5, sep="-")
plaintext = "This text is divided by blocks of length 5!"
encdec(cm, plaintext)

cm = SaveAll(cm0)
plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
encdec(cm, plaintext)

cm.set_alphabet(al.JAPANESE_HIRAGANA)
cm.set_key(u"かぎはにかぎ")
plaintext = u"text いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす !"
encdec(cm, plaintext)

cm = UpperCase(cm)
alphabet = al.GREEK
cm.set_alphabet(alphabet)
cm.set_key(u"κλειδί")
plaintext = u"Θέλει αρετή και τόλμη η ελευθερία. (Ανδρέας Κάλβος)"
encdec(cm, plaintext)

cm.set_key(u"kryptonyckeln")
cm.set_alphabet(al.SWEDISH)
plaintext = u"FAQ om Schweiz: Klöv du trång pjäxby?"
encdec(cm, plaintext)
Exemple #5
0
    u"p", u"h", u"q", u"g", u"m", u"e", u"a", u"y", u"l", u"n", u"o", u"f",
    u"d", u"x", u"k", u"r", u"c", u"v", u"s", u"z", u"w", u"b", u"u", u"t",
    u"ij"
]
cm1.set_alphabet(alphabet)
plaintext = u"Defend the East Wall of the Castle!"
encdec(cm1, plaintext)

cm1 = UpperCase(cm1)
alphabet = [
    u"b", u"g", u"w", u"k", u"z", u"q", u"p", u"n", u"d", u"s", u"ij", u"o",
    u"a", u"x", u"e", u"f", u"c", u"l", u"u", u"m", u"t", u"h", u"y", u"v",
    u"r"
]
cm1.set_alphabet(alphabet)
cm1.set_key(10)
plaintext = "flee at once"
encdec(cm1, plaintext)

cm = SaveAll(cm)

alphabet = al.GREEK_SQUARE
cm.set_alphabet(alphabet)
plaintext = u"Θέλει αρετή και τόλμη η ελευθερία. (Ανδρέας Κάλβος)"
encdec(cm, plaintext)
'''
Текст здесь, много!!!
нит4яжвыяьинтбф
текстздесьмного
----------------------------------
Defend the East Wall of the Castle!
Exemple #6
0
encdec(cm, plaintext)

cm = Block(cm, length=5, sep="-")
plaintext = "This text is divided by blocks of length 5!"
encdec(cm, plaintext)

cm = SaveAll(cm0)
plaintext = "I love non-alphabet characters. These are : ^,&@$~(*;?&#. That's it!"
encdec(cm, plaintext)

cm.set_alphabet(al.ENGLISH_SQUARE_IJ)
plaintext = "Jj becomes Ii because we use ENGLISH_SQUARE_IJ!"
encdec(cm, plaintext)

cm.set_alphabet(al.JAPANESE_HIRAGANA)
cm.set_key(1)
plaintext = u"text あい だやぎへぐゆぢ"
encdec(cm, plaintext)

alphabet = u"abcdeABCDEfghijFGHIJ"
cm.set_alphabet(alphabet)
cm.set_key(3)
plaintext = u"Text aBcdeHijf"
encdec(cm, plaintext)
'''
Output:

========================================================================================
faqomschweizklövdutrångpjäxby
idtrpvfkzhlönocygxwuaqjsmbåeä
faqomschweizklövdutrångpjäxby