コード例 #1
0
def main():
    args = Arguments.get_arguments()
    rsa = RSACalc(args.pprime, args.qprime)
    user_text = get_input_from_user()
    text_to_list = list(user_text)
    print(f'List of Characters ={text_to_list}')
    cipher = encrypt_input(text_to_list, rsa)
    separator = " "
    print(f'your cipher is: {separator.join(map(str, cipher))}')
コード例 #2
0
def main():
    args = Arguments.get_arguments()
    rsa = RSACalc(args.pprime, args.qprime)
    private_key = rsa.private_key
    public_key = rsa.public_key

    cipher_string = get_input_from_user()
    raw_cipher_list = cipher_string.split()  # get rid of commas
    clean_cipher_list = convert_str_list_to_int_list(raw_cipher_list)
    decrypted_str = decrpyt_cipher(clean_cipher_list, private_key, public_key,
                                   rsa)
    print(f'is this your string?: {decrypted_str}')