运行环境python3
12345678910111213141516171819key='helloworld'plaintext='whereisthekey'#key='relations'#plaintext='tobeornottobeth' ascii='abcdefghijklmnopqrstuvwxyz'keylen=len(key)ptlen=len(plaintext)ciphertext = ''i = 0while i < ptlen: j = i % keylen k = ascii.index(key[j]) m = ascii.index(plaintext[i]) ciphertext += ascii[(m+k)%26] i += 1 print (ciphertext)
维吉尼亚
Your support will encourage me to continue to create!