Module crypto
This module adds cryptographic services to jsolait.public members:▲
listEncrypters()
Returns an Array of all available encrypter names.
listDecrypters()
Returns an Array of all available decrypter names.
globals:▲
String::encrypt(crydec)
Encrypts a string using the encrypter specified by the
All parameters but the
crydec
.All parameters but the
crypdec
parameter are forwardet to the encrypter.String::decrypt(crydec)
Decrypts a string using the decrypter specified by the
All parameters but the
crydec
.All parameters but the
crypdec
parameter are forwardet to the decrypter.String::encrypt_xor(key)
Encrypts a string by XOR.
The whole String will be XORed with the
If the key is shorter than the String then it will be multiplied to fit the length of the String.
The whole String will be XORed with the
key
parameter. If the key is shorter than the String then it will be multiplied to fit the length of the String.
String::decrypt_xor
Decrypts a string using XOR.
Since XORing is symetric it is the same as the encrypter.
Since XORing is symetric it is the same as the encrypter.
String::encrypt_rc4(key)
Encrypts a string using the ARC4 algorithm.
The key is a String and can be of any length.
The key is a String and can be of any length.
String::decrypt_rc4
Decrypts a string using the ARC4 algorithm.
Since it is symetric it is the same as the encrypter.
Since it is symetric it is the same as the encrypter.
encrypters/decrypters▲
Currently there are only two encrypters/decrypters xor and rc4.
If you want to add your own at runtime just extend the Stringl class by adding a
If you want to add your own at runtime just extend the Stringl class by adding a
String.prototype.encrypt_yourEncrypter
or
String.prototype.decrypt_yourDecrypter
method.