Crypto¶
Sometimes doing cryptographic operations can be useful in a Cript. Cripts provides a foundation for such tasks, providing hashing, encryption and encoding/decoding.
注釈
This is still very much work in progress, and thus far we've only added the most basic of cryptographic operations. More will be added as needed.
Hash¶
Object |
Description |
|---|---|
|
MD5 hashing. |
|
SHA256 hashing. |
|
SHA512 hashing. |
|
HMAC-SHA256 hashing. |
These objects all provide a Encode() and Decode() method, to hash and unhash strings.
Examples:
do_remap()
{
CDebug("SHA256 = {}", cripts::Crypto::SHA256::Encode("Hello World"));
}
Encryption¶
Currently only one encryption object is provides, for AES256. This object provides
Encrypt() and Decrypt() methods. A Hex() method is also provided to retrieve
the encrypted data as a hex string. For encrypting data in chunks, a Finalize() method
is provided to retrieve the final encrypted data.
Object |
Description |
|---|---|
|
AES256 encryption and decryption. |
Encoding¶
Finally, for convenience, Cripts provides a Base64 object for encoding and decoding, as well
as a URL escaping object, Escape.
Object |
Description |
|---|---|
|
Methods for Base64 encoding. |
|
Methods for URL escaping. |
These objects all provide a Encode() and Decode() method, to encode and decode strings.