I am writing a helper class for encrypting string and other data types. My goal is to make it as easy as possible to use, while still keeping a substantial amount of security.One issue I struggled with was simplifying all the different key and IV sizes. I've settled on having the caller provider a salt, and then generating my own key and IV data from the salt.I assume this compromises the security very slightly, but not that much.I would appreciate hearing other people's thoughts, especially those who have more experience with cryptography than I. Am I compromising my security too much?public virtual byte[] EncryptBytes(byte[] data){    using (SymmetricAlgorithm algorithm = TripleDES.Create())    using (ICryptoTransform encryptor = algorithm.CreateEncryptor(GetKey(algorithm), GetIV(algorithm)))    {        MemoryStream ms = new MemoryStream();        using (Stream cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write))        {            cs.Write(data, 0, data.Length);        }        return ms.ToArray();    }}public byte[] GetKey(SymmetricAlgorithm algorithm){    return DeriveBytes(algorithm.KeySize / 8);}public byte[] GetIV(SymmetricAlgorithm algorithm){    return DeriveBytes(algorithm.BlockSize / 8);}protected byte[] DeriveBytes(int bytes){    Rfc2898DeriveBytes derivedBytes = new Rfc2898DeriveBytes(Password, Salt, 1000);    return derivedBytes.GetBytes(bytes);}
Simplifying Cryptography Key Generation without Losing Security
c#;.net;cryptography
The purpose of an initialization vector is to prevent differential cryptanalysis based on two similar plaintext messages that get encrypted to similar ciphertexts.  The IV does not need to be secret, but you must not reuse one IV for encrypting two messages.  To derive a unique IV for every message, you can use a counter, a fine-resolution timestamp, or a cryptographic-quality random number generator.On the other hand, your GetIV() is a deterministic function of the Password and Salt.  The Password, of course, rarely changes.  The Salt doesn't look like it changes either.  Therefore, your GetIV() fails to return a different IV for every message.