Crate timed_release_crypto

Crate timed_release_crypto 

Source
Expand description

§AES-GCM Authenticated Encryption

AES (Advanced Encryption Standard) is a widely used encryption algorithm for securing data. AES has several operator modes, of which we have selected GCM (Galois/Counter Mode). GCM combines encryption with authentication. This ensures that the data is confidential, but also mechanisms to verify that the data hasn’t been tampered with.

§Large Numbers

Working with large cryptographically secure numbers in Rust involves using crates that provide efficient, secure, and accurate arithmetic for numbers far beyond the size of standard primitive data types like u64 or u128. This is essential in cryptographic contexts where numbers can be hundreds or even thousands of bits long.

Rust does not provide these capabilities natively for large numbers, so we are going to use the crates; num-bigint and rug. num-bigint is beginner-friendly and well-documented.

We will lean heavily on Biguint crate to handle common cryptography primitives and modular operations, such as:

  • large prime numbers : secure generation of large primes
  • modular arithmetic : a mod n in order to ensure that comps stay inside n
  • modular exponentiation : a^b mod n
  • modulo inverse : computing (x^-1 mod n)

§Notes on the use of S, modular exponentiation by squaring

Computing x^2 mod p is generally assumed (TODO: citation needed) to be a single operation that takes constant time. For example, one could just look up the multiplication table, which has only p^2 entries and can be precomputed. For further elaborations on this important topic:

  1. https://en.m.wikipedia.org/wiki/Exponentiation_by_squaring
  2. https://math.stackexchange.com/questions/2944032/ why-is-the-algorithm-for-modular-exponentiation-by-squaring-considered-as-poly-t

§Primality Testing

… TODO: Elaborate on the use of rug. We use the rug crate to perform primatlity testing.

§References:

[1] R. L. Rivest, A. Shamir, and D. A. Wagner. 1996. Time-lock Puzzles and Timed-release Crypto. Technical Report. Cambridge, MA, USA.

[2] Timothy C. May. Timed-release crypto, February 1993. https://cypherpunks.venona.com/date/1993/02/msg00306.html and https://cypherpunks.venona.com/date/1993/02/msg00129.html

Structs§

Capsule
Capsule

Enums§

Primality
For primality test we use the classic Rabin-Miller test.