summaryrefslogtreecommitdiff
path: root/crypto/rot13.py
blob: b2730f153ebad5c454554604b47f85f83aaea438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python

import string

def rot13(char):
    liste = list(string.ascii_lowercase)*2 + list(string.ascii_uppercase)*2
    if char not in liste:
        return char
    else:
        return liste[liste.index(char)+13]

msg = input("Votre message : ")
msgChiffre = str()
for lettre in msg:
    msgChiffre = msgChiffre + rot13(lettre)
print(msgChiffre)