An open API service indexing awesome lists of open source software.

https://github.com/formulae-org/package-cryptography-js

Cryptography package for Fōrmulæ, in JavaScript
https://github.com/formulae-org/package-cryptography-js

cryptographic-keys cryptography cryptography-algorithms decryption digital-signature encryption encryption-decryption formulae hash-digest hashing javascript key-generation rsa-cryptography signature-verification web-application web-crypto-api

Last synced: about 2 months ago
JSON representation

Cryptography package for Fōrmulæ, in JavaScript

Awesome Lists containing this project

README

        

# package-cryptography-js

Cryptography package for the [Fōrmulæ](https://formulae.org) 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](https://github.com/formulae-org) encompasses the source code for the rest of packages, as well as the [web application](https://github.com/formulae-org/formulae-js).

### Description ###

The Fōrmulæ cryptography package is basically a wrapper of the Javascript [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).

> [!IMPORTANT]
> [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/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](https://developer.mozilla.org/en-US/docs/Web/API/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.

### Capabilities ###

#### Key generation ####

* Generation of asymmetric keys for encryption/decryption with the following algorithms:
* [RSA-OAEP](https://www.rfc-editor.org/rfc/rfc3447#section-7.1)

* Generation of symmetric key for encryption/decryption with the following algorithms:
* [AES-CTR](https://w3c.github.io/webcrypto/#bib-nist-sp800-38a)
* [AES-CBC](https://w3c.github.io/webcrypto/#bib-nist-sp800-38a)
* [AES-GCM](https://w3c.github.io/webcrypto/#bib-nist-sp800-38d)

* Generation of keys for signing/verification with the following algorithms:
* [RSASSA-PKCS1-v1_5](https://www.rfc-editor.org/rfc/rfc3447#section-8.2)
* [RSA-PSS](https://w3c.github.io/webcrypto/#bib-rfc3447)
* [ECDSA](https://w3c.github.io/webcrypto/#bib-rfc6090)
* [HMAC](https://w3c.github.io/webcrypto/#bib-fips-198-1)

#### Key serialization ####

AlgorithmKey typeUsageKey serialization
RSA-OAEPPrivateDecryptBase64 format from their PKCS #8 DER-encoded format
RSASSA-PKCS1-v1_5PrivateSign
RSA-PSSPrivateSign
ECDSAPrivateSign
RSA-OAEPPublicEncryptBase64 format from their Subject Public Key Info (SPKI) DER-encoded format
RSASSA-PKCS1-v1_5PublicVerify
RSA-PSSPublicVerify
ECDSAPublicVerify
AES-CTRSecretEncrypt / decryptBase64 format from their raw bytes
AES-CBCSecretEncrypt / decrypt
AES-GCMSecretEncrypt / decrypt
HMACPrivate / publicSign / verify

#### Hashing ####

Supported algorithms:
* [SHA-1]()
* [SHA-256]()
* [SHA-384]()
* [SHA-512]()

#### Encryption

* Encrypt operation
* Decrypt operation

#### Digital signatures ####

* Generation of a digital signture
* Verification of a digital signature

#### Randon number generation

* Pseudo-random number generation, but with enough entropy to be suitable for cryptographic purposes.
* It creates a byte buffer of a given size.