📜  使用 python 代码示例进行加密

📅  最后修改于: 2022-03-11 14:45:34.750000             🧑  作者: Mango

代码示例2
#Made by myself

import random

text = input ( "Enter text: " )

result = ""
private_key = ""

for i in text:

    rand = random.randint ( 1, 125 )
    en = rand + ord ( i )
    en = chr ( en )
    en = str ( en )

    private_key = private_key + str ( rand ) + " "

    result = result + en

print ( "\nPublic key:", result )
print ( "Private key:", private_key )