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))
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))
NICE!!
It'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.)
<3 Thanks for the kind words!! :)