From 7a92932493911442142f544645a209f9038ba98f Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 24 May 2015 16:36:37 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20caract=C3=A8res=20+alphabet=20factoris?= =?UTF-8?q?=C3=A9=20+Affichage=20du=20caract=C3=A8re=20absent=20de=20l'alp?= =?UTF-8?q?habet=20[stable~70]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enigmail/.config | 8 ++++---- enigmail/bucket-file | 3 +-- enigmail/enigmail.sh | 2 +- enigmail/source/decode.py | 10 +--------- enigmail/source/encode.py | 10 +--------- enigmail/source/enigmail.py | 15 +++++++++++++-- enigmail/source/enigmail.pyc | Bin 5191 -> 0 bytes 7 files changed, 21 insertions(+), 27 deletions(-) delete mode 100644 enigmail/source/enigmail.pyc diff --git a/enigmail/.config b/enigmail/.config index d69867e..39dc49b 100644 --- a/enigmail/.config +++ b/enigmail/.config @@ -1,4 +1,4 @@ -smtp_server = smtp1.iut-tlse3.fr -smtp_port = 465 -smtp_login = mrd1609a -mail_address = mrd1609a +smtp_server = smtp.gmail.com +smtp_port = 587 +smtp_login = equal_mailadress_or_different_login +mail_address = test@mail.com diff --git a/enigmail/bucket-file b/enigmail/bucket-file index e214881..8b13789 100644 --- a/enigmail/bucket-file +++ b/enigmail/bucket-file @@ -1,2 +1 @@ -coucou test :p -P \ No newline at end of file + diff --git a/enigmail/enigmail.sh b/enigmail/enigmail.sh index bb5f0f1..a0ac77c 100644 --- a/enigmail/enigmail.sh +++ b/enigmail/enigmail.sh @@ -16,7 +16,7 @@ then # si 1 paramètre 'write') nano "$path/bucket-file";; # ouvre en modification le bucket file 'empty') echo "">"$path/bucket-file";; # vide le bucket file # ouvre en lecture le bucket file - 'read') echo "\n======================================="; cat "$path/bucket-file"; echo "\n=======================================";; + 'read') echo "\n======================================="; cat "$path/bucket-file"|less; echo "\n=======================================";; 'encode') python "$path/source/encode.py";; 'decode') python "$path/source/decode.py";; 'send') python "$path/source/send.py";; diff --git a/enigmail/source/decode.py b/enigmail/source/decode.py index b6554b4..264d6b6 100644 --- a/enigmail/source/decode.py +++ b/enigmail/source/decode.py @@ -13,15 +13,7 @@ inFile.close(); # DEFINITION DE L'ALPHABET -SIGMA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; # maj -SIGMA += 'abcdefghijklmnopqrstuvwxyz'; # min -SIGMA += '&=+^~@%,.?!:;[](){}-_#$*/ \\"\'\n'; # ponctuation + retour charriot -SIGMA += '0123456789'; # digit -SIGMA += 'éèêàùç'; # accents -SIGMA = SIGMA.decode('utf-8'); - -# ALPHABET FORMATE EN LISTE -SIGMA = list(SIGMA); +SIGMA = getSigma(); # CHOIX DE LA CLE userkey = int( raw_input('Cle (hex ou int): '), 0); diff --git a/enigmail/source/encode.py b/enigmail/source/encode.py index aacb069..bfa8848 100644 --- a/enigmail/source/encode.py +++ b/enigmail/source/encode.py @@ -13,15 +13,7 @@ inFile.close(); # DEFINITION DE L'ALPHABET -SIGMA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; # maj -SIGMA += 'abcdefghijklmnopqrstuvwxyz'; # min -SIGMA += '&=+^~@%,.?!:;[](){}-_#$*/ \\"\'\n'; # ponctuation + retour charriot -SIGMA += '0123456789'; # digit -SIGMA += 'éèêàùç'; # accents -SIGMA = SIGMA.decode('utf-8'); - -# ALPHABET FORMATE EN LISTE -SIGMA = list(SIGMA); +SIGMA = getSigma(); # CHOIX DE LA CLE userkey = int( raw_input('Cle (hex ou int): '), 0); diff --git a/enigmail/source/enigmail.py b/enigmail/source/enigmail.py index 5a15621..c864cbd 100644 --- a/enigmail/source/enigmail.py +++ b/enigmail/source/enigmail.py @@ -55,6 +55,17 @@ def sendMail(pConf, pPass, pTo, pSubject, pMessage): +# fonction qui renvoie l'alphabet +def getSigma(): + SIGMA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; # maj + SIGMA += 'abcdefghijklmnopqrstuvwxyz'; # min + SIGMA += '&=+^~@%,.?!:;[](){}-_#$*/ \\"«»\'\n'; # ponctuation + retour charriot + SIGMA += '0123456789'; # digit + SIGMA += 'éèêàâùçîô'; # accents + SIGMA = SIGMA.decode('utf-8'); + + # ALPHABET FORMATE EN LISTE + return list(SIGMA); # fonction qui calcule le nombre de rotors en fonction de la clé pKey et qui retourne un entier def calcLevel(pKey, pSIGMA): @@ -125,7 +136,7 @@ def encodeChar(pChar, pSIGMA, pROTOR): pChar = pSIGMA[ pROTOR[r].index(pChar) ]; # le caractere devient celui au rang de l'alphabet correspondant au rang du caractere dans le rotor r return pChar; except ValueError: # si un caractère n'est pas dans l'alphabet - print "[ERREUR] Caractere non present dans l'alphabet"; + print "[ERREUR] Caractere %s non present dans l'alphabet" % pChar; raise SystemExit(0); # fonction qui decode un caractere pChar via les rotors @@ -135,7 +146,7 @@ def decodeChar(pChar, pSIGMA, pROTOR): pChar = pROTOR[r][ pSIGMA.index(pChar) ]; # le caractere devient celui au rang de l'alphabet correspondant au rang du caractere dans le rotor r return pChar; except ValueError: # si un caractère n'est pas dans l'alphabet - print "[ERREUR] Caractere non present dans l'alphabet"; + print "[ERREUR] Caractere %s non present dans l'alphabet" % pChar; raise SystemExit(0); diff --git a/enigmail/source/enigmail.pyc b/enigmail/source/enigmail.pyc deleted file mode 100644 index c8efda9656ea4f383d9e24528b4656774f6a8606..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5191 zcmcIo-E!PW749C{6VJrs{3kmh!Lxx{hAP%BsMKbc^)5+l#|ep@tj57hz@!wZJtJEq z$x@FQZ#g$)d4Rp)ihTvDxS@Cr?sy9>cmVjm)8ny|0&cKvseO*R)j!|)&X4TKg;x7M!#wv9n2fY?m)SHTW zt<`~6+giO*>UBkAJXcD`&^{{+GVpQ3tLgxkrw%67!tO_E!{U9J6|n78RPiUO9a~i$VBcxiu=Ta_EZX_Gx%s&; zOSj^#aUq%>|es`<0P_M~HL5&IFzP0F>nMcGs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