Files
opensim/OpenSim/Framework
Adil El Farissi db80781e7d Basic implementation of AES encryption/decryption and respective OSSL functions
Add methods:
+ private static string AESEncryptString(string secret, string plainText, string ivString= null)
AES Encrypt a string using a password and a random or custom Initialization Vector.

+ private static string AESDecryptString(string secret, string encryptedText, string ivString= null)
AES Decrypt the string encrypted by AESEncryptString with the same password and ivString used in the encryption.

Methods implementations:
+ Util.AESEncrypt(string secret, string plainText)
+ Util.AESDecrypt(string secret, string encryptedText)
+Util.AESEncryptTo(string secret, string plainText, string ivString)
+ Util.AESDecryptFrom(string secret, string encryptedText, string ivString)

OSSL functions as first case of use:
+ osAESEncrypt(string secret, string plainText)
+ osAESDecrypt(string secret, string encryptedText)
+ osAESEncryptTo(string secret, string plainText, string ivString)
+ osAESDecryptFrom(string secret, string encryptedText, string ivString)

LSL script example:
<pre><code>
string plainText = "Hello World :)";
string secret = "#!qUeRtY$@123^456€!#";

default
{
    touch_start(integer i)
    {
        string encryptedText = osAESEncrypt(secret, plainText);
        llOwnerSay("\nEncrypted with osAESEncrypt:\n"+ encryptedText);
        string decryptedText = osAESDecrypt(secret, encryptedText);
        llOwnerSay("\nDecrypted with osAESDecrypt:\n"+ decryptedText);

        // Encription / Decription with custom Initialization Vector.
        string ivString = (string)llGetOwner() /* +"_"+ llGenerateKey() */;
        string encryptedToText = osAESEncryptTo(secret, plainText, ivString);
        llOwnerSay("\nEncrypted with osAESEncryptTo:\n"+ encryptedToText);
        string decryptedFromText = osAESDecryptFrom(secret, encryptedToText, ivString);
        llOwnerSay("\nDecrypted with osAESDecryptFrom:\n"+ decryptedFromText);
    }
}
</code></pre>

Web Rain :)
2024-02-23 21:14:33 +00:00
..
2022-12-15 22:19:09 +00:00
2023-11-12 22:24:53 +00:00
2022-03-13 02:05:56 +00:00
2022-10-16 19:21:54 +01:00
2023-06-23 01:21:04 +01:00
2022-04-17 22:13:33 +01:00
2020-05-17 17:16:29 +01:00
2022-01-08 23:35:56 +00:00
2023-03-10 09:09:00 +00:00
2022-01-09 02:28:51 +00:00
2017-08-29 07:38:52 +01:00
2022-10-05 01:53:24 +01:00
2022-01-08 23:35:56 +00:00
2014-09-24 00:21:14 +02:00
2023-05-21 20:46:54 +01:00
2022-01-13 20:31:52 +00:00
2021-07-16 03:08:31 +01:00
2019-10-22 11:55:27 +01:00
2022-04-23 16:41:18 +01:00
2022-01-13 13:59:41 +00:00
2020-08-28 23:41:34 +01:00
2023-04-25 23:53:26 +01:00
2020-08-22 12:38:35 +01:00
2023-02-25 12:40:37 +00:00
2022-09-20 21:32:10 +01:00
2022-01-08 23:35:56 +00:00
2024-01-02 23:07:12 +00:00
2022-10-16 15:06:36 +01:00
2023-11-29 12:17:08 +00:00
2022-11-12 03:27:11 +00:00
2022-03-13 02:05:56 +00:00
2021-07-23 03:04:59 +01:00
2023-02-24 12:35:12 +00:00
2023-02-23 23:56:46 +00:00
2022-10-16 15:06:36 +01:00
2023-05-13 16:39:14 +01:00
2023-03-29 20:11:04 +01:00