paysec-crypto 0.2.1

Cryptographic provider interfaces for the paysec payment security libraries.
Documentation
  • Coverage
  • 31.58%
    6 out of 19 items documented0 out of 13 items with examples
  • Size
  • Source code size: 5.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 241.88 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • 5n00py/paysec
    7 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • 5n00py

paysec-crypto

Core cryptographic provider traits used by the paysec payment-security libraries.

This crate defines cryptographic interfaces and common AES types, but does not provide a cryptographic implementation itself. Concrete providers are supplied by crates such as paysec-crypto-rustcrypto and paysec-crypto-soft-aes.

Features

The crate currently provides provider traits for:

  • AES block encryption and decryption
  • AES-CBC encryption and decryption
  • AES-CMAC
  • AES-CMAC-based key derivation
  • AES-128, AES-192, and AES-256 key-size modeling

Provider traits are generic over the key type. This allows software providers to operate on raw key material while leaving room for providers backed by opaque key handles, such as Hardware Security Modules.

Installation

[dependencies]
paysec-crypto = "0.2.0"

Example

use paysec_crypto::{AesBlockCipher, AesKeySize};

fn key_length(key_size: AesKeySize) -> usize {
    key_size.bytes()
}

assert_eq!(key_length(AesKeySize::Bits128), 16);
assert_eq!(key_length(AesKeySize::Bits256), 32);

Implementations

Software implementations are available separately:

  • paysec-crypto-rustcrypto
  • paysec-crypto-soft-aes

Security

This crate defines cryptographic interfaces only. Security properties depend on the concrete provider and on how keys are stored and managed.

For project-level documentation, see the paysec repository.