Reputation: 688
Suppose we have an ID of a person that we want to keep secret and external applications should never know it (for example a social security number). If a person makes an action, we want to inform the external application that some person did this and that. If the person makes multiple such requests, we want the external application aware that it's from the same user.
So we need a unique ID that's like a shadow of the social security number. We can generate unique ID for each user, but we'd like to avoid storing anything. So we were thinking that we'd only encrypt the social security number. However, each encrypted value of the social security number would be unique due to IV, so the external user wouldn't be able to say if two actions were done by the same user.
Is there a cipher that allows this and is secure enough or is there a way to achieve this without storing any additional data?
Edit: forgot to mention that the external applications can in turn query for more data about that particular user. So we need a way to again deanonymize/decrypt the identifier that we originally sent him.
Upvotes: 0
Views: 136
Reputation: 9806
From your question and comments, it sounds like you have the following requirements:
This is one of the rare cases where ECB mode can be safe. It is important that you select a block cipher that has a block size larger than your maximum plaintext length, in bytes.
In this case, Rijndael with a 192 bit block size is what I would pick, but you might struggle to find implementations. If you don't need to be conservative with length, Rijndael with a 256 bit block size is fine too.
So, simply:
Do not:
Upvotes: 2