Encrypting and Decrypting DataSets encdecdataset Provides two methods for encrypting and decrypting data from a single instance of a DataSet. Calling EncryptDataSet() will cause three files to be generated: 1) a serialized jagged byte array holding the DES key and vector, 2) the encrypted DataSet instance's data and 3) the DataSet instance's schema. Calling DecryptDataSet() will read the preceding three files: 1) it will deserialize the DES key and vector, 2) decrypt and load into the DataSet instance the data and 3) load into the DataSet instance the schema. Note that these two methods will work with one instance of a DataSet. If you call EncryptDataSet() with several instances, you may encounter problems. Therefore, the preceding methods are designed to deal with one instance of a DataSet. If you require encryption and decryption for several DataSet instances then you should pass the methods unique file names for each one accordingly. Please note that this code is the most basic employed. You should implement try-catch blocks as well as conditional checks for the existence of the various files being read and written to. Also, be aware that if you intend to decrypt the DataSet, you must have present all three of the files discussed above. So, for example, if you plan on encrypting the DataSet on computer A and decrypting it on computer B, make sure the files generated are copied to computer B before decryption occurs (ensuring that the paths to the files are properly set as well).
strDESBinFile System.String The file that is to store the serialized jagged array of both the DES' Key and IV byte arrays. "DES.bin" strDataSetBinFile System.String The file that is to store the encrypted DataSet instance. "DataSet.bin" strDataSetSchemaFile System.String The file that is to store the DataSet instance's schema. "DataSet.xsd"