|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.metasyntactic.security.RivestShamirAdleman
| Method Summary | |
static java.util.List |
chunkString(java.lang.String s,
java.math.BigInteger n)
|
static java.lang.String |
decrypt(org.metasyntactic.security.RivestShamirAdleman.PrivateKey privateKey,
java.lang.String M)
|
static java.lang.String |
encrypt(org.metasyntactic.security.RivestShamirAdleman.PublicKey publicKey,
java.lang.String M)
|
static void |
encryptInput(int numPrimes,
java.lang.String M)
|
static java.math.BigInteger[] |
extendedEuclideanAlgorithm(java.math.BigInteger a,
java.math.BigInteger b)
Input: positive integers a and b Output: integers x and y such that gcd(a, b) = xa + yb |
static java.math.BigInteger |
gcd(java.math.BigInteger a,
java.math.BigInteger b)
|
static java.math.BigInteger |
greatestCommonDivisor(java.math.BigInteger a,
java.math.BigInteger b)
|
static java.math.BigInteger |
inverse(java.math.BigInteger a,
java.math.BigInteger m)
Given a and m, we know that gcd(a, m) = a*x + m*y. |
static org.metasyntactic.security.RivestShamirAdleman.KeyPair |
keyPairGenerator(java.util.Collection primes)
|
static org.metasyntactic.security.RivestShamirAdleman.KeyPair |
keyPairGenerator(int numPrimes)
|
static void |
main(java.lang.String[] args)
|
static java.math.BigInteger |
n(java.util.Collection primes)
Returns the product of the elements of primes |
static java.math.BigInteger |
powerMod(java.math.BigInteger base,
java.math.BigInteger exponent,
java.math.BigInteger modulus)
|
static java.math.BigInteger |
powerModulus(java.math.BigInteger base,
java.math.BigInteger exponent,
java.math.BigInteger modulus)
Returns (base ^ exponent) % modulus |
static java.util.Set |
randomPrimes(int k)
|
static java.util.Set |
randomPrimes(int k,
int certainty)
|
static java.util.Set |
randomPrimes(int k,
int certainty,
int bits)
Creates a set of k distinct primes. |
static java.math.BigInteger |
randomRelativePrime(java.math.BigInteger t)
|
static java.math.BigInteger |
randomRelativePrime(java.math.BigInteger t,
int bits)
|
static java.math.BigInteger |
randomRelPrime(java.math.BigInteger t)
|
static java.math.BigInteger |
totient(java.util.Collection primes)
When n is a positive integer, Euler's totient function, , is defined to be the number of positive integers not greater than n and relatively prime to n |
static java.lang.String |
unchunkString(java.util.List chunks)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.util.Set randomPrimes(int k)
public static java.util.Set randomPrimes(int k,
int certainty)
public static java.util.Set randomPrimes(int k,
int certainty,
int bits)
public static java.math.BigInteger n(java.util.Collection primes)
primes - A collection of BigIntegers
public static java.math.BigInteger totient(java.util.Collection primes)
public static java.math.BigInteger gcd(java.math.BigInteger a,
java.math.BigInteger b)
public static java.math.BigInteger greatestCommonDivisor(java.math.BigInteger a,
java.math.BigInteger b)
public static java.math.BigInteger randomRelPrime(java.math.BigInteger t)
public static java.math.BigInteger randomRelativePrime(java.math.BigInteger t)
public static java.math.BigInteger randomRelativePrime(java.math.BigInteger t,
int bits)
public static java.math.BigInteger powerMod(java.math.BigInteger base,
java.math.BigInteger exponent,
java.math.BigInteger modulus)
public static java.math.BigInteger powerModulus(java.math.BigInteger base,
java.math.BigInteger exponent,
java.math.BigInteger modulus)
public static java.math.BigInteger inverse(java.math.BigInteger a,
java.math.BigInteger m)
public static java.math.BigInteger[] extendedEuclideanAlgorithm(java.math.BigInteger a,
java.math.BigInteger b)
public static java.util.List chunkString(java.lang.String s,
java.math.BigInteger n)
public static java.lang.String unchunkString(java.util.List chunks)
public static java.lang.String encrypt(org.metasyntactic.security.RivestShamirAdleman.PublicKey publicKey,
java.lang.String M)
public static java.lang.String decrypt(org.metasyntactic.security.RivestShamirAdleman.PrivateKey privateKey,
java.lang.String M)
public static org.metasyntactic.security.RivestShamirAdleman.KeyPair keyPairGenerator(int numPrimes)
public static org.metasyntactic.security.RivestShamirAdleman.KeyPair keyPairGenerator(java.util.Collection primes)
public static void encryptInput(int numPrimes,
java.lang.String M)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||