Skip to content

formulae-org/package-cryptography-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package-cryptography-js

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.

Description

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.

Capabilities

Key generation

  • 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:

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:

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.