Cryptographic Number Theory

The Wolfram Language's extensive base of state-of-the-art algorithms and efficient handling of very long integers make it uniquely suited to both research and implementation of cryptographic number theory.

Encryption and Decryption

PowerMod compute modular powers of integers

PowerModList compute modular inverses, with negative and fractional powers

PolynomialMod  ▪  BitXor  ▪  BitAnd  ▪  BitOr  ▪  BitSet  ▪  BitGet

Key Generation

RandomPrime pseudorandom prime

Prime the n th prime

PrimeQ test for primality

Mod  ▪  JacobiSymbol  ▪  PrimitiveRoot  ▪  PrimitiveRootList  ▪  CarmichaelLambda  ▪  MoebiusMu

$CryptographicEllipticCurveNames supported standard elliptic curves


FactorInteger complete or incomplete integer factorization

MultiplicativeOrder compute the discrete logarithm

EulerPhi Euler totient function

Reduce solve multivariate quadratic polynomials

CharacterCounts compute -gram frequencies

Lattice-Oriented Problems

LatticeReduce find short basis vectors in an integer lattice

LatticeData properties of named lattices

Textual Data

Hash, FileHash compute MD5 and other hash codes

ToCharacterCode, FromCharacterCode convert between strings and character codes

ByteArray raw array of arbitrary bytes

BaseDecode, BaseEncode convert between a byte array and its Base64 representation

Other Forms of Cryptography

CellularAutomaton efficiently compute general block maps

Practical Cryptography »

GenerateAsymmetricKeyPair generate RSA, elliptic curve and other keys

Encrypt  ▪  Decrypt  ▪  PrivateKey  ▪  PublicKey  ▪  DigitalSignature  ▪  ...