ToyPublicKeys.RSAKey
— TypeRSAKey
Union of RSAPrivateKey and RSAPublicKey for methods, that do not require specific key.
ToyPublicKeys.RSAPrivateKey
— TypeRSAPrivateKey
RSAPrivateKey is PrivateKey struct for RSA. It holds all information to derive public key and make efficient calculations.
ToyPublicKeys.RSAPublicKey
— TypeRSAPublicKey
RSAPublicKey is PublicKey struct for RSA.
It holds all neccecary information to perform public key computations, but not more.
ToyPublicKeys.RSADP
— MethodRSAStep(::pkcs1_v1_5_t, msg::BigInt, key::RSAPublicKey)
RSA exponentiation step when only public key is available. Uses repeated squares and other fast modulo exponentiation tricks in its GMP implementation (Base.GMP.MPZ.powm).
ToyPublicKeys.RSAEP
— MethodRSAStep(::pkcs1_v1_5_t, msg::BigInt, key::RSAPrivateKey)
Fast implementation of the RSA exponentiation step when RSAPrivateKey is provided. It uses Chinese remainer theorem for very fast exp() mod n
calculations.
ToyPublicKeys.RSASP1
— MethodRSASP1(::pkcs1_v1_5_t, msg::BigInt, key::RSAPrivateKey)
ToyPublicKeys.RSAStep
— MethodRSAStep(::pkcs1_v1_5_t, msg::String, key::RSAKey)
RSA exponentiation step for Strings. Only prepares the buffer for RSAStep(msg::BigInt, key::RSAPublicKey)
.
ToyPublicKeys.RSAStep
— MethodRSAStep(::pkcs1_v1_5_t, msg::AbstractVector{T}, key::RSAKey) where {T<:Base.BitInteger}
RSA exponentiation step for AbstractVectors (arbitrary buffers). Only prepares the buffer for RSAStep(msg::BigInt, key::RSAPublicKey)
.
ToyPublicKeys.RSAVP1
— MethodRSAVP1(::pkcs1_v1_5_t, msg::BigInt, key::RSAPublicKey)
ToyPublicKeys.decrypt
— Methoddecrypt(::pkcs1_v1_5_t,
msg::Vector{UInt8},
key::RSAPrivateKey)
RSA decryption function, expects PKCS#1 v1.5.
ToyPublicKeys.decrypt
— Methoddecrypt(::pkcs1_v2_2_t,
msg::Vector{UInt8},
key::RSAPrivateKey)
RSA decryption function, expects PKCS#1 v2.2.
ToyPublicKeys.decrypt
— Methoddecrypt(msg::Vector{UInt8},
key::RSAPrivateKey)
RSA decryption function, expects PKCS#1 v2.2.
ToyPublicKeys.encrypt
— Methodencrypt(::pkcs1_v1_5_t,
msg::Vector{UInt8},
key::RSAPublicKey)
RSA encryption function with PKCS#1 v1.5.
ToyPublicKeys.encrypt
— Methodencrypt(::pkcs1_v2_2_t,
msg::Vector{UInt8},
key::RSAPublicKey)
RSA encryption function with PKCS#1 v2.2.
ToyPublicKeys.encrypt
— Methodencrypt(msg::Vector{UInt8},
key::RSAPublicKey)
RSA encryption function with PKCS#1 v2.2.
ToyPublicKeys.generate_rsa_key_pair
— Methodgenerate_rsa_key_pair(::pkcs1_v1_5_t, bits::Integer)
RSA key pair constructor (hopefully) according to PKCS#1 v1.5
ToyPublicKeys.is_probab_prime_p
— Methodis_probab_prime_p(n::BigInt, n_tests::Int)
Binding for GMPlib's gmpzprobabprime_p function. Only uses probability based tests as it would equal factoring n
` otherwise.
ToyPublicKeys.power_crt
— Methodpower_crt(base::BigInt, pow::BigInt, p::BigInt, q::BigInt)
Wrapper around core implementation, only for generating the parameters if they are not provided.
ToyPublicKeys.power_crt
— Methodfunction power_crt(
base::BigInt,
p::BigInt,
q::BigInt,
d_p::BigInt,
d_q::BigInt,
q_inv::BigInt,
)
CRT for PKCS #1 based parameters.
ToyPublicKeys.power_crt_components
— Methodpower_crt_components(d::BigInt, p::BigInt, q::BigInt)
Utility function for calculating dth power in p*q mod CRT parameters for PKCS #1.
ToyPublicKeys.power_crt_components
— Methodpower_crt_components(e::BigInt, d::BigInt, primes::Vector{BigInt})
Utility function for calculating the CRT parameters for PKCS #1.
ToyPublicKeys.rand_prime_for_rsa
— Functionrand_prime_for_rsa(bits::Integer, no_gcd_with=big"65537")
Helper function for rsa random primes, since they should satisfy special properties.
ToyPublicKeys.random_bigint_from_range
— Methodrandom_bigint_from_range(bits::Integer)
Custom random big int function since core julia does not yet provide 'proper one' (in my opinion).
ToyPublicKeys.sign
— Methodsign(::pkcs1_v1_5_t,
msg::Vector{UInt8},
key::RSAPrivateKey)
Sign string with RSA key by PKCS#1 v1.5
ToyPublicKeys.sign
— Methodsign(::pkcs1_v2_2_t,
msg::Vector{UInt8},
key::RSAPrivateKey)
Sign string with RSA key by PKCS#1 v2.2
ToyPublicKeys.sign
— Methodsign(msg::Vector{UInt8},
key::RSAPrivateKey)
Sign string with RSA key by PKCS#1 v2.2
ToyPublicKeys.verify_signature
— Methodverify_signature(::pkcs1_v1_5_t,
msg::Vector{UInt8},
signature::Vector{UInt8},
key::RSAPublicKey)
Verify the signature by PKCS#1 v1.5
ToyPublicKeys.verify_signature
— Methodverify_signature(::pkcs1_v2_2_t,
msg::Vector{UInt8},
signature::Vector{UInt8},
key::RSAPublicKey)
Verify the signature by PKCS#1 v2.2
ToyPublicKeys.verify_signature
— Methodverify_signature(msg::Vector{UInt8},
signature::Vector{UInt8},
key::RSAPublicKey)
Verify the signature by PKCS#1 v2.2
ToyPublicKeys.RSAKey
ToyPublicKeys.RSAPrivateKey
ToyPublicKeys.RSAPublicKey
ToyPublicKeys.RSADP
ToyPublicKeys.RSAEP
ToyPublicKeys.RSASP1
ToyPublicKeys.RSAStep
ToyPublicKeys.RSAStep
ToyPublicKeys.RSAVP1
ToyPublicKeys.decrypt
ToyPublicKeys.decrypt
ToyPublicKeys.decrypt
ToyPublicKeys.encrypt
ToyPublicKeys.encrypt
ToyPublicKeys.encrypt
ToyPublicKeys.generate_rsa_key_pair
ToyPublicKeys.is_probab_prime_p
ToyPublicKeys.power_crt
ToyPublicKeys.power_crt
ToyPublicKeys.power_crt_components
ToyPublicKeys.power_crt_components
ToyPublicKeys.rand_prime_for_rsa
ToyPublicKeys.random_bigint_from_range
ToyPublicKeys.sign
ToyPublicKeys.sign
ToyPublicKeys.sign
ToyPublicKeys.verify_signature
ToyPublicKeys.verify_signature
ToyPublicKeys.verify_signature