Gentee
  • Gentee script programming language
  • Language Reference
    • Lexical elements
    • Types
    • Declarations
    • Statements
    • Error handling
    • Expressions
    • Running programs
    • Multithreading
    • Include and import
  • Standard Library Reference
    • Archiving
    • Array
    • Boolean
    • Buffer
    • Characters
    • Console
    • Constants
    • Context
    • Cryptography
    • Encoding
    • Files
    • Float numbers
    • Integer
    • Map
    • Multithreading
    • Network
    • Object
    • Path
    • Process
    • Regular expressions
    • Runtime
    • Sets
    • Strings
    • System
    • Time
  • Go Integration
    • Reference
    • Compilation and execution
    • Advanced features
    • Playground
  • Change language
    • Русский
Powered by GitBook
On this page
  • Functions
  • AESDecrypt( str key, buf data ) buf
  • AESEncrypt( str key, buf data ) buf
  • Md5(buf|str data) buf
  • RandomBuf(int size) buf
  • Sha256(buf|str data) buf

Was this helpful?

  1. Standard Library Reference

Cryptography

PreviousContextNextEncoding

Last updated 4 years ago

Was this helpful?

The cryptographic functions are described below.

Functions

AESDecrypt( str key, buf data ) buf

The AESDecrypt function decrypts the content of the buf variable using the key encryption key. The encrypted data must be obtained using the AESEncrypt function. The function returns a variable of the buf type with decrypted data.

buf encrypted = AESDecrypt(`my password`, encrypted)

AESEncrypt( str key, buf data ) buf

The AESEncrypt function encrypts the content of a buf variable using the AES-256 algorithm. The key parameter is an encryption key. The function returns a variable of buf type with encrypted data. Use the AESDecrypt function to decrypt the data.

buf crypted = AESEncrypt(`my password`, buf(`Test message`))

Md5(buf|str data) buf

The Md5 function returns MD5 hash of the buf or str type variable.

RandomBuf(int size) buf

The RandomBuf function returns a variable of the buf type that contains a sequence of random bytes of the specified size.

Sha256(buf|str data) buf

The Sha256 function returns SHA5 hash of the buf or str type variable.

AESDecrypt( str key, buf data ) buf
AESEncrypt( str key, buf data ) buf
Md5( buf | str data ) buf
RandomBuf( int size ) buf
Sha256( buf | str data ) buf