Skip to content

Security Functions

Hash

:hash(text, type)

Generates a hash of the text using the specified algorithm.

Supported types: md5, sha1, sha256, sha512

:hash(pass123, md5)     # Result: 482c811da5d5b4bc6d497ffa98491e38
:hash(pass123, sha256)  # SHA-256 hash result

Encryption

:encrypt(text, key, type)

Encrypts a text using the specified key and encryption type.

Supported types: fernet (default), caesar, vigenere

:encrypt(secret text, key123, vigenere)

:decrypt(text, key, type)

Decrypts a text using the specified key and encryption type.

@encrypted = :encrypt(secret message, key123, vigenere)
:decrypt(@encrypted, key123, vigenere)  # Result: secret message

Password Generation

:gen_password(length, lowercase, uppercase, digits, punctuation)

Generates a random password with the specified characteristics.

Also available as :genPassword() and :genpassword().

Parameters: - length: Password length (required) - lowercase: Include lowercase letters (true" or "false", default is "true") - uppercase: Include uppercase letters ("true" or "false", default is "true") - digits: Include digits ("true" or "false", default is "true") - punctuation: Include punctuation ("true" or "false", default is "true")

:gen_password(12)                                  # Password with all character types
:gen_password(8, true, true, false, false) # Letters only
:gen_password(10, false, true, true, false) # Uppercase and digits