Overview
The SST module is an implementation of a simple encryption and decryption algorithm using a custom substitution table, transposition, and XOR operations. The module provides two functions, encryptTransaction
and decryptTransaction
, for encrypting and decrypting transaction data. Both functions require a key argument, which is used to encrypt and decrypt the data.
I created this module to learn more about encryption and decryption, and I thought it might be useful for others to use as reference or for something else. If you have any feedback or ideas for improvement, please feel free to share them. I will update the module if I make any major additions during my free time.
Usage
To use the SST module, you can simply require it in your Roblox game:
local SST = require(game:GetService("ServerScriptService").SimpleSecureTransaction)
Then, you can use the encryptTransaction
and decryptTransaction
functions to encrypt and decrypt transaction data.
encryptTransaction(transactionData: string, key: string): string
The encryptTransaction
function takes two arguments: transactionData
, which is the data you want to encrypt, and key
, which is the password used to encrypt the data. The function returns an encrypted string.
Example usage:
local transactionData = "This is a secret message"
local key = "my_password"
local encryptedData = SST.encryptTransaction(transactionData, key)
print(encryptedData)
-- Example output: Mhs%$%)hJf)e%Hjh1Hkxhjsdf
decryptTransaction(encryptedTransactionData: string, key: string): string
The decryptTransaction
function takes two arguments: encryptedTransactionData
, which is the encrypted data you want to decrypt, and key
, which is the password used to decrypt the data. The function returns a decrypted string.
Example usage:
local encryptedData = "Mhs%$%)hJf)e%Hjh1Hkxhjsdf"
local key = "my_password"
local decryptedData = SST.decryptTransaction(encryptedData, key)
print(decryptedData)
-- Example output: This is a secret message
SST.authenticate(providedPassword: string): boolean
The authenticate
function takes a password as an argument and returns a boolean indicating whether the provided password matches the password stored in the module. This function is used internally by the encryptTransaction
and decryptTransaction
functions to ensure that the provided password is correct.
Example usage:
local password = "my_password"
local isPasswordCorrect = SST.authenticate(password)
(Before using the module, make sure to change the default password in the module to your own custom one)
Security Considerations
It’s important to note that the SST module is not a strong encryption algorithm and should not be used to protect sensitive data. The module’s encryption and decryption algorithms are simple and can be easily cracked by determined attackers. Additionally, the module’s password is stored in plaintext, which is also a security risk. If you need to protect sensitive data, it’s recommended that you use a stronger encryption algorithm and store passwords securely.
Download
(You are free to use, copy, or modify the module without any obligations or restrictions)