public final class Crypto
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
aesDecrypt(byte[] ivCiphertext,
byte[] key) |
static byte[] |
aesEncrypt(byte[] plaintext,
byte[] key) |
static byte[] |
aesGCMDecrypt(byte[] ivCiphertext,
byte[] key) |
static byte[] |
aesGCMEncrypt(byte[] plaintext,
byte[] key) |
static void |
curve(byte[] Z,
byte[] k,
byte[] P) |
static byte[] |
getKeySeed(java.lang.String secretPhrase,
byte[]... nonces) |
static java.security.MessageDigest |
getMessageDigest(java.lang.String algorithm) |
static byte[] |
getPrivateKey(byte[] keySeed) |
static byte[] |
getPrivateKey(java.lang.String secretPhrase) |
static byte[] |
getPublicKey(byte[] keySeed) |
static byte[] |
getPublicKey(java.lang.String secretPhrase) |
static java.security.SecureRandom |
getSecureRandom() |
static byte[] |
getSharedKey(byte[] myPrivateKey,
byte[] theirPublicKey) |
static byte[] |
getSharedKey(byte[] myPrivateKey,
byte[] theirPublicKey,
byte[] nonce) |
static boolean |
isCanonicalPublicKey(byte[] publicKey) |
static boolean |
isCanonicalSignature(byte[] signature) |
static java.security.MessageDigest |
ripemd160() |
static long |
rsDecode(java.lang.String rsString) |
static java.lang.String |
rsEncode(long id) |
static java.security.MessageDigest |
sha256() |
static java.security.MessageDigest |
sha3() |
static byte[] |
sign(byte[] message,
java.lang.String secretPhrase) |
static boolean |
verify(byte[] signature,
byte[] message,
byte[] publicKey,
boolean enforceCanonical) |
public static java.security.SecureRandom getSecureRandom()
public static java.security.MessageDigest getMessageDigest(java.lang.String algorithm)
public static java.security.MessageDigest sha256()
public static java.security.MessageDigest ripemd160()
public static java.security.MessageDigest sha3()
public static byte[] getKeySeed(java.lang.String secretPhrase, byte[]... nonces)
public static byte[] getPublicKey(byte[] keySeed)
public static byte[] getPublicKey(java.lang.String secretPhrase)
public static byte[] getPrivateKey(byte[] keySeed)
public static byte[] getPrivateKey(java.lang.String secretPhrase)
public static void curve(byte[] Z, byte[] k, byte[] P)
public static byte[] sign(byte[] message, java.lang.String secretPhrase)
public static boolean verify(byte[] signature, byte[] message, byte[] publicKey, boolean enforceCanonical)
public static byte[] getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey)
public static byte[] getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)
public static byte[] aesEncrypt(byte[] plaintext, byte[] key)
public static byte[] aesGCMEncrypt(byte[] plaintext, byte[] key)
public static byte[] aesDecrypt(byte[] ivCiphertext, byte[] key)
public static byte[] aesGCMDecrypt(byte[] ivCiphertext, byte[] key)
public static java.lang.String rsEncode(long id)
public static long rsDecode(java.lang.String rsString)
public static boolean isCanonicalPublicKey(byte[] publicKey)
public static boolean isCanonicalSignature(byte[] signature)