Cryptography

This document describes the cryptograhy methods provided by aah. All of aah cryptography methods are developed using Go standard libraries. aah cryptography methods are ready to use and completely tested. It could save hours of efforts that require in research and implementation.

import "aahframe.work/security/acrypto"

Encryption Methods

Method NameDescription
AESEncryptStringEncrypts text with AES. The key argument should be 16 or 24 or 32 bytes to select AES-128 or AES-192 or AES-256 correspondingly
AESDecryptStringDecrypts text with AES. The key argument should be the one that is used during encryption
AESEncryptEncrypts bytes with given cipher.Block in CTR mode
AESDecryptDecrypts bytes with given cipher.Block in CTR mode

Sign Methods

Method NameDescription
SignStringSigns the given text using the key provided with HMAC SHA. Supported SHA’s are SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512
VerifyStringVerifies the signed text and text using the key provided with HMAC SHA. Returns true if sign text is valid; returns false otherwise
SignSigns the given bytes using HMAC and given SHA name. Supported SHA’s are SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512
VerifyVerifies whether the given key, value and mac are valid. If they are valid, it returns true; otherwise, returns false