Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 639 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 639 Bytes

SimpleCryptNet

C# (.NET) implementation of the SimpleCrypt used int QT

Usage like:

// Encrypt

SimpleCrypt simpleCrypt = new SimpleCrypt(0x3456ABCD);
simpleCrypt.SetIntegrityProtectionMode(IntegrityProtectionMode.ProtectionHash);
simpleCrypt.SetCompressionMode(CompressionMode.CompressionAlways);

string fileContent = File.ReadAllText(filePathText);
byte[] encryptedData = simpleCrypt.EncryptToByteArray(fileContent);
File.WriteAllBytes(filePath, encryptedData);

// Decrypt

SimpleCrypt simpleCrypt = new SimpleCrypt(0x3456ABCD);
string decryptedText = simpleCrypt.DecryptToString(File.ReadAllBytes(filePath));