Reimplementing Beaufort ciphers