String Encryptor API
- v0.0.1, published at : 12/01/2024
Description
A simple tool to encrypt your string data. This allows you to encrypt by using Caeser Cipher, X0R and Fibonacci.
How to use it
PHP Code:
enum {
Caeser_Cipher,
X0R,
Fibonacci
}
/**
* Encrypt a String
*
* @param iMethod Caeser_Cipher / X0R / Fibonacci
* @param szInput Original String
* @param szOutput Output (Encrypted)
* @param iMaxLen Output Max Lenght
* @param iKey Used for X0R & Caeser Cipher Methods
*/
native str_encrypt(iMethod, const szInput[], szOutput[], iMaxLen, iKey = 0)
/**
* Decrypt a String
*
* @param iMethod Caeser_Cipher / X0R / Fibonacci
* @param szInput Encrypted String
* @param szOutput Output (Decrypted String)
* @param iMaxLen Output Max Lenght
* @param iKey Used for X0R & Caeser Cipher Methods
*/
native str_decrypt(iMethod, const szInput[], szOutput[], iMaxLen, iKey = 0)
The important note here is the iKey.- Fibonacci does not require a key.
- On Caeser Cipher you must use a key. I would recommend a value between 2 and 10.
- On X0R method you should also use a key, you can find bellow some key examples.
X0R Example Keys- 0x42
- 0x7F
- 0xAA
- 0xF0
- 0x88
- 0xC5
- 0x3E
- 0xD7