Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The AesDecrypt()
function decrypts a base64 encoded ciphertext to plaintext, using the given key and initialization vector.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a plaintext.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
Name | Type | Required | Description |
---|---|---|---|
ciphertext
text
The input base64 encoded text which was encrypted you want to decrypt. It should be encrypted with the same key and vector values and using the AES algorithm.
key
text
Text or data field that holds the encryption key. A key can be generated using AesKey()
vector
text
Text or data field that holds the encryption vector. A proper Vector value can be generated using AesIv()
encoding with BOM
yes/no
enable or disable encoding with BOM.
The AesEncrypt()
function generates a base64 encoded ciphertext based on the given plaintext, key and initialization vector.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a base64 encoded ciphertext
Returns invalid key
if the wrong key is used and invalid initialization vector
if the wrong vector is used.
Name | Type | Required | Description |
---|---|---|---|
plaintext
text
The text to encrypt.
key
text
Text or data field that holds the encryption key. A key can be generated using AesKey()
vector
text
Text or data field that holds the encryption vector. A proper Vector value can be generated using AesIv()
encoding with BOM
yes/no
enable or disable encoding with BOM (check the receiving party if BOM is required/expected).
The Md5()
function hashes one or more text strings into one hexadecimal text value which is hashed using the MD5 algorithm.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Hashed values cannot be decoded, usually you check an incoming value against a known value that you hash yourself and check if both values are identical, to verify correctness without knowing the actual value.
Returns a 128-bit hexadecimal representation of an MD5 hashed value.
Returns unknown
if one of the parameter values is unknown or outside the common valid boundaries.
Name | Type | Required | Description |
---|---|---|---|
text1
text
a text
text2
text
another text
file
file
a file
The PasswordStrength()
function Calculates a numeric representation of the strength of a password from 0 (blank), 1 (very weak) up to 5 (very strong).
Combining different types of characters makes for stronger passwords, but a very long password of only lowercase characters (like a sentence) can also be strong.
Returns a number between 0 and 5.
0 - blank
1 - very weak
2 - weak
3 - medium
4 - strong
5 - very strong
The following factors increase the strength of a password:
Lowercase characters
Uppercase characters
Numbers
Symbols
Password length
This function is NOT SQL compatible. For more information about SQL compatibility, see our .
Name | Type | Required | Description |
---|
| text | input password |
The PBKDF2()
function creates a secure password hash for a password and a salt by using the PBKDF2 hashing algorithm with 1000 iterations.
WIKI: http://en.wikipedia.org/wiki/PBKDF2
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Hashed values cannot be decoded, usually you check an incoming value against a known value that you hash yourself and check if both values are identical, to verify correctness without knowing the actual value.
Returns a text that contains a hash key of 40 characters. Returns unknown if the salt length is less than 8
The Sha1()
function hashes a specified text string with SHA1, and returns a hexadecimal text string.
SHA-1 is not considered secure, but some older systems still use this encryption. WEM supports this ONLY at your own risk, and ONLY to be used to integrate with other systems that provide no other way.
WIKI: https://en.wikipedia.org/wiki/SHA-1
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Hashed values cannot be decoded, usually you check an incoming value against a known value that you hash yourself and check if both values are identical, to verify correctness without knowing the actual value.
Returns a hexadecimal text string.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
Name | Type | Required | Description |
---|---|---|---|
Name | Type | Required | Description |
---|---|---|---|
Functions and use this as parameter.
This function is NOT SQL compatible. For more information about SQL compatibility, see our .
Generates a unique 256 bit AES key, to be used with the AES encryption and decryption functions.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
password
text
text containing a password
salt
text
a salt text. The value must be at least 8 characters long. An unknown value is returned if the length is less than 8.
text
text
a text
The Password()
function returns a text that contains a randomly generated strong password with a specified number of characters.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a text by default of 8 characters.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
The Totp()
function calculates a time-based one-time password based on the given secret and given UTC time.
WIKI: https://en.wikipedia.org/wiki/Time-based_one-time_password
MyWEM Forum: https://my.wem.io/forum?threadid=184
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a text
value based on the given secret and UTC time, containing 6 numbers.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries. May throw a Server500 error when the secret is NOT a proper Base32 value with characters from the collection "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
"
The CreateJsonWebTokenH256()
function returns the HMAC-SHA256 encoded JWT (JSON Web Token) for given payload (json value) and secret (password text), using the standard JWT header {alg=HS256 and typ=JWT} or a custom header.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
JWT tokens are used in authentication (Single Sign On) contexts, and designed to be compact, URL-safe and secure. Sites like Google or Zoom use JWT. They may provide information on how to work with their JWT for sign-on (with code examples for PHP, Python or C#), and if it supports the standard implementation, you can use this WEM Function to create the proper JWT - just provide the proper values for the payload and the secret. For the extensive standard information behind standard JWT, read the wiki pages.
This WEM implementation is following the basic standards - some sites may have custom implementations that deviate and therefore may not work with the WEM implementation.
Returns a Json Web Token (wiki) using the HMAC-SHA265 algorithm.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
The HmacSha256()
function calculates a MAC (message authentication code) on provided message using the SHA256 hash function and a key/secret, and returns the calculated MAC as a hexadecimal text string.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Hashed values cannot be decoded, usually you check an incoming value against a known value that you hash yourself and check if both values are identical, to verify correctness without knowing the actual value.
Returns a hexadecimal text representation of a message, which is hashed using the Sha265 function and the key/secret for additional calculation/hashing.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
The Sha256()
function hashes a specified text string with SHA256, and returns a hexadecimal text string. This hash function is preferred to SHA-1, being more secure.
Hashed values cannot be decoded, usually you check an incoming value against a known value that you hash yourself and check if both values are identical, to verify correctness without knowing the actual value.
Returns a hexadecimal text string.
Returns Unknown
if one of the parameter values is unknown or outside the common valid boundaries.
Name | Type | Required | Description |
---|---|---|---|
Name | Type | Required | Description |
---|---|---|---|
Name | Type | Required | Description |
---|---|---|---|
Name | Type | Required | Description |
---|---|---|---|
WIKI:
This function is NOT SQL compatible. For more information about SQL compatibility, see our .
Name | Type | Required | Description |
---|
num_chars
numeric
a number representing the amount of characters of the generated password. Should be at least 4, higher is better.
secret
Base32 text
secret the password is based on. Must be base32 encoded and must contain any of the characters from the collection as indicated in the syntax example.
date
date time
UTC time or time and interval the password is based on.
payload
text
A json-formed set of claims (see wiki
)
secret
text
Text or data field that holds the encryption secret.
secretisbase64encoded
yes/no
indicates whether the secret is base64 encoded (true) or plaintext (false)
customheader
text
You can also use a custom header according to the JWT definition
.
key
text
a text with the secret key for HmacSha256 encryption
message
text
the message or content
returnbase64
yes/no
return result as base64 (if true)
| text | a text |