Cryptography package for the Fōrmulæ programming language.
Fōrmulæ is also a software framework for visualization, edition and manipulation of complex expressions, from many fields. The code for an specific field —i.e. arithmetics— is encapsulated in a single unit called a Fōrmulæ package.
This repository contains the source code for the cryptography package. It is intended for generation of cryptographic keys, for ecryption and decryption, for hasing and to create signatures and verifying them.
The GitHub organization formulae-org encompasses the source code for the rest of packages, as well as the web application.
The Fōrmulæ cryptography package is basically a wrapper of the Javascript Web Crypto API.
Important
Web Crypto API is a powerful, low-level cryptography suite which uses real cryptographic algorithms and parameters. This Fōrmulæ package is intended to provide a higher-level interface to users and programmers. However, as with Web Crypto API, it is highly recommended that you have a medium to high knowledge of the cryptographic concepts and mathematical background to be used effectively in production.
On the other hand, it is very suitable for educational purposes, but again, a basic to medium knowledge of cryptographic concepts is assumed.
-
Generation of asymmetric keys for encryption/decryption with the following algorithms:
-
Generation of symmetric key for encryption/decryption with the following algorithms:
-
Generation of keys for signing/verification with the following algorithms:
Algorithm | Key type | Usage | Key serialization |
---|---|---|---|
RSA-OAEP | Private | Decrypt | Base64 format from their PKCS #8 DER-encoded format |
RSASSA-PKCS1-v1_5 | Private | Sign | |
RSA-PSS | Private | Sign | |
ECDSA | Private | Sign | |
RSA-OAEP | Public | Encrypt | Base64 format from their Subject Public Key Info (SPKI) DER-encoded format |
RSASSA-PKCS1-v1_5 | Public | Verify | |
RSA-PSS | Public | Verify | |
ECDSA | Public | Verify | |
AES-CTR | Secret | Encrypt / decrypt | Base64 format from their raw bytes |
AES-CBC | Secret | Encrypt / decrypt | |
AES-GCM | Secret | Encrypt / decrypt | |
HMAC | Private / public | Sign / verify |
Supported algorithms:
- Encrypt operation
- Decrypt operation
- Generation of a digital signture
- Verification of a digital signature
- Pseudo-random number generation, but with enough entropy to be suitable for cryptographic purposes.
- It creates a byte buffer of a given size.