Ana içeriğe geç
Version: 1.0.1

Encryption

What Is Encryption ?

Encryption is a way of scrambling data so that only authorized parties can understand the information. In technical terms, it is the process of converting human-readable plaintext to incomprehensible text, also known as ciphertext. In simpler terms, encryption takes readable data and alters it so that it appears random. Encryption requires the use of a cryptographic key: a set of mathematical values that both the sender and the recipient of an encrypted message agree on. For more.

Milvasoft is not responsible of possible data loss.

To take advantage of encryption, you must create an object from the MilvaEncryptionProvider class. In order to benefit from encryption operations with dependency injection, you must register the IMilvaEncryptionProvider type in the service collection. This class uses AES encryption. You can encrypt/decrypt string or file. For more.

Usage


// Your key must be 128 bit.
var provider = new MilvaEncryptionProvider(key: "2r5u8x/A?D(G-KaP");

var value = "Test value!";

// Output : "s5VWDHn4IegFMJME2HAlxHPSIaCrWiZEwH7fhq/YgAY="
var encryptedValue = provider.Encrypt(value);

// Output : "Test value!"
var decryptedValue = provider.Decrypt(encryptedValue);