Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I am aware of the benefits of adding a salt to values that are hashed using a one-way function. Is adding a salt to a value that is being encrypted (using symmetric encryption) considered to be good practice as well?

The salt (unlike the encryption key) is likely to be stored in the same data source as the encrypted data. I'm wondering if this adds a weakness, rather than improve security (for example: by making it possible to decipher the encryption key).

share|improve this question
4  
Is this not what an Initialisation Vector is for? –  lynks May 14 '13 at 11:56
    
Why exactly would you salt what you encrypted. The entire point of encrypting data is to decrypt it. –  Ramhound May 14 '13 at 15:39

3 Answers 3

up vote 6 down vote accepted

A salt is a cryptographically-secure random non-repeating value, added to the password before hashing it, rendering rainbow tables useless and making it impossible to attack more than one password by attacking one hash.

An initialization vector (IV) is a cryptographically-secure random non-repeating value added as the initial state to a block cipher algorithm depending on the mode of operation, preventing the cipher from producing the same ciphertext for similar blocks of the plaintext, thus denying the attacker the opportunity to infer relationships between segments of the encrypted message.

Both a salt and an IV aren't secret information, in fact, in most cases the IV is transported with the message itself. Implemented correctly, an IV shouldn't make it any easier to "crack" the encryption. On the contrary, it should make it even harder. The security of the cipher system should depend on the secrecy of key, and only on the secrecy of the key, AKA Kerckhoffs's principle:

That the security of a cipher system should depend on the key

Oh, also, don't implement your own crypto and use it in a production environment, AKA Don't be a Dave.

share|improve this answer

A salt has absolutely no benefit for encryption. If anything, it could (though it shouldn't) make the encryption less secure. If it turns out that a known plaintext attack is found (an attack that allows information to be gained from a cypher text about the key by knowing part of the plain text) then having a public value encrypted would make every message weak to that type of attack.

It's also worth pointing out that you don't "hash using a one-way function". A hash IS a one way function. The (somewhat simplified) point of a salt is to complicate the input so that an attacker can't pre-generate values for common passwords or values and simply look up what the value that went in to the hash, effectively leveraging a prior attack against future attacks. A salt makes it so that effort has to be performed for every attack.

share|improve this answer

I am aware of the benefits of adding a salt to values that are hashed using a one-way function. Is adding a salt to a value that is being encrypted (using symmetric encryption) considered to be good practice as well?

I think your approach is flawed and will weaken the integrity of the cipher it self. By appending the salt with the plaintext that is going to be encrypted we are subjecting to known plaintext attack.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.