Ejemplo n.º 1
0
def caesar_cipher(text, shift):
    return ''.join(shift_char(c, shift) for c in text)
Ejemplo n.º 2
0
def caesar_cipher(text, shift):
    return ''.join(shift_char(c, shift) for c in text)
Ejemplo n.º 3
0
def one_time_pad(msg, pad=None):
    if pad is None:
        pad = (randint(0, len(lowercase) - 1) for _ in range(len(msg)))

    return ''.join(shift_char(char, shift) for char, shift in izip(msg, pad))
Ejemplo n.º 4
0
def one_time_pad(msg, pad=None):
    if pad is None:
        pad = (randint(0, len(lowercase) - 1) for _ in range(len(msg)))

    return ''.join(shift_char(char, shift) for char, shift in izip(msg, pad))