# Super-simple encryption of short strings

I want to anonymise the initials of experiment participants by giving each a pseudonymic set of initials, by encrypting their true initials. Their initials are only two or three letters in length.

These are data from individual human experiment participants that I publish online and in scientific journals. The convention (from a more innocent time) is to inset each participant's initials in a graph of their data. Using Github I will publish all the code and anonymised data, excepting the key (more background: https://plus.google.com/+AlexHolcombe/posts/1sNgTnnAtYz). Symmetric encryption seems fine.

Is there a suitable algorithm simple enough to quickly implement in the R statistical language? I came across the Vignere cipher, which seems to be exactly what I need, but I know almost nothing about cryptography so perhaps that is naive. http://www.counton.org/explorer/codebreaking/vigenere-cipher.php

• Is "a symmetric encoding" in the sense of symmetric encryption vs. PKE, or something else? $\hspace{.91 in}$ – user991 Apr 22 '15 at 5:09
• @RickyDemer I meant symmetric encryption as opposed to PKE and with just one key, very very simple. – Alex Holcombe Apr 22 '15 at 5:14
• How many letters long are the initials? $\;$ – user991 Apr 22 '15 at 5:24
• If for example there was only one patient with 3-letters ID, s/he is not going to like your "I think it is ok to preserve their length".$\;$ Formally, you want Format Preserving Encryption on the set of 2-or-3-letters blobs, which has 26⋅26⋅27 elements. This is so small that a table of 18252 at-least-15-bit values implementing a pseudo-random permutation is feasible, and might be the simplest. – fgrieu Apr 22 '15 at 5:57
• 1) Why use encryption at all? I'd rather use a lookup table/tokenization. 2) If you want to use crypto, why use format-preserving-encryption? 2) Anonymizing data sets is hard. It's often possible to correlate data from different sources to deanonymize such data. – CodesInChaos Apr 22 '15 at 8:58