I have a system which is receiving around 15 million records every day (in separate files each file has around 150K records) . the system will convert these files from binary to ascii and then will feed the data into multiple downstream systems .
there is a new requirement now that we have to encrypt one of the fields (lets call it Field A) in each record , fieldA’s length is always between 6 to 10 digits .
1.the encryption should be done in a way that the result will only
contain printable characters
2.the performance is very important here
3.we have other fields in each record which can be used as encryption/decryption keys like date time but there is no guarantee that these other fields are unique (which should not be important).
4.other downstream systems should be able to decode the result using a key (I’m very new to data encryption but I think this key is called private key) .
5.I’ve read different articles about SALTing , do you think that SALTing can be of any use in our scenario here ?
what do you think is the best encryption algorithm for me to use here ? does .net framework provide implementation of this algorithm ?
You have two separate issues here:
The latter is easy: use
Convert.ToBase64String(byte[]). All the encryption algorithms I know of work in terms of binary data, so you’ll need to convert your input into binary first (e.g. usingEncoding.UTF8.GetBytes(text)), then encrypt, then convert back to text usingConvert.ToBase64String. Decrypting is a matter of usingConvert.FromBase64String, then applying the decryption binary-to-binary algorithm, then reversing your original conversion (e.g.Encoding.UTF8.GetString(binary)).You haven’t really given enough information to determine which encryption algorithm you should use – whether it should be symmetric or asymmetric, for example – but salting is usually involved in one-way hashes, not reversible encryption. A similar concept in terms of initialization vectors applies to several encryption algorithms though.