Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Basic question- if I'm encoding a bunch of known filetypes with salsa20, will it still be secure if the plaintext header is known?

Assume that a different IV and Key are generated before each file is encrypted (or at least, it's statistically impossible for an attacker to know whether or not different files were encrypted with the same IV or key, and it's very unlikely that 2 in fact were)

I.e. the attacker will precisely know the first 64 bytes or so of the plaintext file, not the remaining mega/gigabytes, and does not have a comparison file which was likely to be encrypted with the same IV and Key

share|improve this question
    
@D.W. Salsa20 is a stream cipher. It always uses something similar to CTR mode. –  CodesInChaos May 10 '13 at 8:36
1  
@davidkomer It's essential to use a distinct nonce for every message you encrypt. If you do that, Salsa20 is pretty secure. You should also consider adding authentication, so active attacks are rejected. –  CodesInChaos May 10 '13 at 8:38
    
@CodesInChaos - thanks, updated to reflect that point –  davidkomer May 10 '13 at 12:28
    
It depends. There are many details. For instance, if you use a key derived from a password, it'll likely be insecure. If you fail to use authenticated encryption (e.g., a MAC), it'll be susceptible to chosen-ciphertext attacks. There are a number of ways to go wrong. Usually you shouldn't try to encrypt in this way; instead, you should use an existing, well-vetted scheme/software, like GnuPG –  D.W. May 10 '13 at 16:02
add comment

1 Answer 1

Yes, because there are no known weaknesses in (full) Salsa20.

http://www.researchgate.net/publication/226808260_The_Salsa20_Family_of_Stream_Ciphers

share|improve this answer
add comment

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.