Skip to content
@openspb

openspb

Elixir libraries for financial messaging, cryptography and PKI.

OpenSPB

OpenSPB hosts Elixir libraries for financial messaging, cryptography and PKI. Some implement the message formats and security protocols of the Brazilian financial system (SPB, the Sistema de Pagamentos Brasileiro), such as Pix and the RSFN network. The others are general-purpose: key stores, signatures and encryption that any Elixir application can use.

They share a few rules:

  • Pure Elixir. Everything runs on :crypto and :public_key, which come with OTP: no NIF, no openssl binary, and no runtime dependencies.
  • Written from the public specifications. RFCs, ISO 20022 schemas and the manuals that Banco Central do Brasil publishes.
  • Checked against other tools. The test suites of pkcs12 and cmsex have OpenSSL, Python, Java and others read what the library writes, and read what those tools write.

General-purpose libraries

Library What it does
pkcs12 Hex.pm Reads and writes PKCS#12 files (.pfx, .p12): the private key, its certificate and the rest of the chain, ready for :ssl and :public_key. Opens the old RC2 and 3DES files too, even where OpenSSL 3 has no legacy provider. It plays the role of openssl pkcs12.
cmsex Hex.pm Cryptographic Message Syntax (RFC 5652): signs and verifies .p7s files with RSA, RSASSA-PSS, ECDSA, Ed25519 and Ed448, countersignatures and certificate bundles; encrypts to certificates, shared keys and passwords; digests and MACs. It plays the role of openssl cms.

The Brazilian financial system

Library What it does
isox Hex.pm ISO 20022 codec for the message catalog of the SPI, the instant payment system behind Pix: encode/2 and decode/1 by envelope, a dictionary with the meaning of each field, and XMLDSig signatures in the profile of the Manual de Segurança do SFN.
sinetex Hex.pm The security envelope of the RSFN, the network that connects financial institutions, clearing houses and Banco Central do Brasil: the 588-byte security header, Security Protocol v3 (AES-256-GCM) and v2 (3DES).

How they fit together

A certificate and its key usually arrive as a .pfx. pkcs12 opens it and hands the key and the certificate, in DER, to sinetex to build the RSFN envelope, to isox to sign a Pix message, or to cmsex to sign a document.

Contributing

Issues and pull requests are welcome in each repository. To report a vulnerability, follow the SECURITY.md of the library. pkcs12, sinetex and cmsex are under the Apache-2.0 license, and isox under MIT.

Pinned Loading

  1. isox isox Public

    Codec ISO 20022 das mensagens do SPI (Pix) em Elixir: encode e decode por envelope, dicionário de campos do catálogo do BCB e assinatura XMLDSig.

    Elixir 2

  2. sinetex sinetex Public

    Security envelope of the RSFN, the Brazilian Financial System Network, in Elixir: the 588-byte security header, Security Protocol v3 (AES-256-GCM) and v2 (3DES).

    Elixir

  3. pkcs12 pkcs12 Public

    PKCS#12 (.pfx, .p12) reader and writer in pure Elixir: private key and certificate chain, legacy and modern algorithms, no NIF.

    Elixir

  4. cmsex cmsex Public

    Cryptographic Message Syntax (CMS, RFC 5652) in pure Elixir: sign and verify .p7s files, encrypt and decrypt, digests and MACs, no NIF.

    Elixir

Repositories

Showing 5 of 5 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…