Security

You can use these functions to secure your apps saved data or send data securely across the web. Note that base64 encoded data is not cryptographically secure

Reference the library

C#
using CI.WSANative.Security;

Encrypt data using aes

The key should be 32 random ascii characters long (i.e 32 bytes)

The initialisation vector should be 16 random ascii characters long (i.e 16 bytes)

C#
WSANativeSecurity.SymmetricEncrypt("ffffffffffffffffffffffffffffffff", "aaaaaaaaaaaaaaaa", "Tesing123");

Decrypt data using aes

You must use the same key and initialise vector that were used to encrypt the data

C#
WSANativeSecurity.SymmetricDecrypt("ffffffffffffffffffffffffffffffff", "aaaaaaaaaaaaaaaa", "SomeEncryptedData");

Base64 encode data

C#
WSANativeSecurity.EncodeBase64("SomeData");

Base64 decode data

C#
WSANativeSecurity.DecodeBase64("SomeBase64Data");