Methods used in message transmission security
This article lists all methods that are used for encoding and decoding a message, signing a message and validating the signature, and encrypting and decrypting a message.
Encoding related methods
utf8_encode
A method that encodes the binary data to the UTF-8-encoded text string.
base64urlsafe_encode
A method that implements the Base64 encoding algorithm as specified in RFC 3548. It encodes the arbitrary binary data to the text strings that can be safely used as parts of URLs, or included as part of an HTTP POST request.
Decoding related methods
base64urlsafe_decode
A method that implements the Base64 decoding algorithm as specified in RFC 3548. It decodes the text string that is encoded by using the base64urlsafe_encode
method to the original binary data.
Signature related methods
sha256withrsa_sign
A method that uses a private key to generate a signature based on the input data. It firstly calculates the hash over the data by using the SHA256 function, then pads the hash by using the RSASSA-PKCS1-v1_5 signature schema, and finally implements encryption by using the RSA algorithm.
sha256withrsa_verify
A method that validates whether the content string to be validated matches the signature that is generated with sha256withrsa_sign
.
Encryption related methods
rsa_encrypt
A method that encrypts messages by using the algorithms of RSA, ECB, and PKCS1Padding.
aes_encrypt
This method encrypts message by using AES (Advanced Encryption Standard). For more information about AES, see ISO/IEC 18033-3: Block ciphers.
Decryption related methods
rsa_decrypt
A method that decrypts the cipher text that is encrypted by using the algorithms of RSA, ECB, and PKCS1Padding.
aes_decrypt
A method that decrypts the cipher text that is encrypted by using AES.