DES encryption is not safe and although the code is a little old check out the vector and key in the code below, Triple DES is much safe. The crux of encryption is predictiblity and creating vector and key randon will make things more unpredictable and in this case user 192 bits for it.
Reference:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.tripledescryptoserviceprovider.aspx
Referred following
using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; using System.Security.Cryptography;
Initialization
TripleDESCryptoServiceProvider cryptic = new TripleDESCryptoServiceProvider(); IFormatter formatter = new BinaryFormatter(); Stream stream = null;
Serialize
stream = new FileStream("MyConfig.txt", FileMode.Create, FileAccess.Write, FileShare.None); using (CryptoStream cs = new CryptoStream(stream, new TripleDESCryptoServiceProvider().CreateEncryptor(cryptic.Key, cryptic.IV), CryptoStreamMode.Write)) { formatter.Serialize(cs, testClassObject); cs.FlushFinalBlock(); } stream.Close();
Deserialize
stream = new FileStream("MyConfig.txt", FileMode.Open, FileAccess.Read, FileShare.None); using (CryptoStream cs = new CryptoStream(stream, new TripleDESCryptoServiceProvider().CreateEncryptor(cryptic.Key, cryptic.IV), CryptoStreamMode.Read)) { testClassObject = (TestClass)formatter.Deserialize(cs); } stream.Close();
Reference:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.tripledescryptoserviceprovider.aspx
If you are in Jaipur and need beautiful Call Girls in Jaipur or white skin Call Girls in Jaipur then you can simply book call girls in Jaipur from one of the best escort agency named Call Girls in Jaipur. It is No.1 premier escort agency and provide both incall or outcall facility to clients.Please click on the following link to check the official websites Call Girls in Jaipur
ReplyDeleteCall Girls in Kolkata
ReplyDeleteCall Girls in Mumbai
Call Girls in Lucknow
Call Girls in Gurgaon
Call Girls in Bangalore
Call Girls in Guwahati
======================
Escorts
======================
Escorts in Kolkata
Escorts in Mumbai
Escorts in Lucknow
Escorts in Gurgaon
Escorts in Bangalore
Escorts in Guwahati
Escort services
======================
Escort services in Kolkata
Mumbai Escort Service
Escort services in Lucknow
Escort services in Gurgaon
Escort services in Bangalore
Escort services in Guwahati
======================
Escort service
======================
Escort Service in Kolkata
Escort Service in Mumbai
Escort Service in Lucknow
Escort Service in Gurgaon
Escort Service in Bangalore
Escort Service in Guwahati