I was trying to figure out a way to encrypt a small payload in a transaction memo to anonymize the memo id without having to store anything on the server (like a memo -> user mapping).
To achieve this I was planning to do a simple encryption/decryption:
const cryptr = new Cryptr(encryptionKey);
function getDepositToken(username, algo) {
return cryptr.encrypt(username);
}
function getUserNameFromDepositToken(depositToken) {
return cryptr.decrypt(username);
}
However, with usernames > 10 characters the smallest I could get it was 40 bytes using a wide range of encryption algorithms.
My end goal is to encrypt user id + nonce or timestamp so that I can completely anonymize deposits for a given user id without having to store a mapping for them all in a db.
Does anyone else have any tips to being able to fit slightly more data in it? I was hoping I could get to 15-20 characters.