If you are encrypting data, you should ask yourself who decrypts it. If you use an asymmetric encryption system (for example, RSA), then encryption uses the public key, and decryption uses the corresponding private key; "asymmetry" is based on the fact that the private key cannot be recalculated from the public key (although both keys are mathematically connected together).
Asymmetric encryption has overhead. The first remark is that such encryption should have some random part in it, because everyone can encrypt (public key, yes, public): if the encryption process is deterministic, then anyone can encrypt all possible SSNs (there are less than billion of them, which is very small for a modern computer) and correspond to encrypted values. Therefore, there should be some random addition during encryption, and the encrypted SSN is larger than the plaintext SSN.
Known asymmetric encryption systems use mathematical structures that have their own costs. In principle, for an RSA encryption system with a βstrong enoughβ key, the encrypted message will be at least 128 bytes long. Some encryption systems do better; adhering to the well-trodden paths of academic research, I could do it in 41 bytes or so (with El-Gamal above the elliptic curve NIST K-163). Less seems harder.
Therefore, it is not surprising that this database system did not enable such a function by default.
For your problem, you should first determine (and write) as much as possible:
- what data you want to protect.
- who enters data
- which should read the data back
and only then you should ask yourself if encryption is a suitable tool for this. Encryption is good when the alleged attacker can access raw, stored data. This means that the attacker circumvented the protection of the operating system. At this point, regardless of the operating system, the attacker also knows. If the database is hosted on a machine and there is an interface through which a decrypted SSN can be obtained, then this machine βknowsβ how to get the data, and the attacker also does it ... On the other hand, if the host machine operating system is considered to be quite stable, then encryption is not required at all.
Symmetric encryption in the database may be a weaker problem when an attacker subsequently receives a copy of the hard disk. The host system knows the symmetric encryption key, but it knows this only in RAM. An attacker stealing a hard drive will not have this key.
Thomas pornin
source share