Remix.run Logo
zahlman 4 days 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 4 days ago | parent [-]

NICE!!

zahlman 4 days ago | parent [-]

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.)

SethMLarson 3 days ago | parent [-]

<3 Thanks for the kind words!! :)