I want to encrypt a file and want to know what's the best method for going about this.
In steps:
1)I will be encrypting the message using Rijndael 256. The key would be created by a randomly generated salt, IV and random passphrase using PKCS#5.
2)Once that key is created, it and the IV used to create it is then encrypted by PKCS#5 with a randomly generated salt, IV and the passphrase supplied by the user. This would then be put in the file.
3)That IV and salted used in (2) are then encrypted using Rijndael 256 with the user supplied passphrase and randomly generated IV. This IV is embedded into the file header in plain text(basically).
How does this sound folks
The reason I did things like this is because I wanted the key use to created the message to have a very strong encryption so I had to created using PKCS#5 unfortunately that called for the use of a salt and those have to be used in the decryption so then it needs to be placed in the file.
I needed to embed the key and IV used to created the message encryption into the file so of course those needed to be encrypted before being embedded. I once again used PKCS#5 and therefore had to use an IV and salt again and the user passphrase. The salt and IV now needed to be secured so I then use Rijndael 256 to do this since all it needs is an IV and user passphrase. That IV I just embedded now as a plain text.
Does this sound secure albeit convoluted? I already have the program up running. I did the code in C# for Windows and Java for everything else. I just need to know if its worthy of deployment.
In steps:
1)I will be encrypting the message using Rijndael 256. The key would be created by a randomly generated salt, IV and random passphrase using PKCS#5.
2)Once that key is created, it and the IV used to create it is then encrypted by PKCS#5 with a randomly generated salt, IV and the passphrase supplied by the user. This would then be put in the file.
3)That IV and salted used in (2) are then encrypted using Rijndael 256 with the user supplied passphrase and randomly generated IV. This IV is embedded into the file header in plain text(basically).
How does this sound folks
The reason I did things like this is because I wanted the key use to created the message to have a very strong encryption so I had to created using PKCS#5 unfortunately that called for the use of a salt and those have to be used in the decryption so then it needs to be placed in the file.
I needed to embed the key and IV used to created the message encryption into the file so of course those needed to be encrypted before being embedded. I once again used PKCS#5 and therefore had to use an IV and salt again and the user passphrase. The salt and IV now needed to be secured so I then use Rijndael 256 to do this since all it needs is an IV and user passphrase. That IV I just embedded now as a plain text.
Does this sound secure albeit convoluted? I already have the program up running. I did the code in C# for Windows and Java for everything else. I just need to know if its worthy of deployment.