Exemple #1
0
def encrypt(text, pub_key):
    block_size = rsa.common.byte_size(pub_key.n) - 11
    encrypted = ""
    for part in split_len(text, block_size):
        encrypted += rsa.encrypt(part, pub_key)
    return encrypted
Exemple #2
0
def encrypt(text, pub_key):
    block_size = rsa.common.byte_size(pub_key.n) - 11
    encrypted = ""
    for part in split_len(text, block_size):
        encrypted += rsa.encrypt(part, pub_key)
    return encrypted
Exemple #3
0
def decrypt(encrypted, pri_key):
    block_size = rsa.common.byte_size(pri_key.n)
    text = ""
    for part in split_len(encrypted, block_size):
        text += rsa.decrypt(part, pri_key)
    return text
Exemple #4
0
def decrypt(encrypted, pri_key):
    block_size = rsa.common.byte_size(pri_key.n)
    text = ""
    for part in split_len(encrypted, block_size):
        text += rsa.decrypt(part, pri_key)
    return text