3 ms·
It's not necessary to write the ciphering logic. CIPHER, UNCIPHER = str.maketrans(CIPHER), str.maketrans(UNCIPHER) print(s := 'STREAM CIPHER'.translate(CI
by zahlman 1y ago
It's not necessary to write the ciphering logic.
CIPHER, UNCIPHER = str.maketrans(CIPHER), str.maketrans(UNCIPHER)
print(s := 'STREAM CIPHER'.translate(CIPHER))
print(s.translate(UNCIPHER))
- SethMLarson 1y agoNICE!!
- zahlman 1y agoIt's truly an honour to have been able to teach the PSF's Security Developer-in-Residence something about the implementation of a simple substitution cipher in Python. ;) (In all seriousness, thanks for all your excellent work. The many projects you help out with — and advocate for — in the Python ecosystem, including CPython itself, are all far better off for it.)
- SethMLarson 1y ago<3 Thanks for the kind words!! :)