public final class Crypto
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
aesDecrypt(byte[] ivCiphertext,
byte[] myPrivateKey,
byte[] theirPublicKey) |
static byte[] |
aesDecrypt(byte[] ivCiphertext,
byte[] myPrivateKey,
byte[] theirPublicKey,
byte[] nonce) |
static byte[] |
aesEncrypt(byte[] plaintext,
byte[] myPrivateKey,
byte[] theirPublicKey) |
static byte[] |
aesEncrypt(byte[] plaintext,
byte[] myPrivateKey,
byte[] theirPublicKey,
byte[] nonce) |
static void |
curve(byte[] Z,
byte[] k,
byte[] P) |
static java.security.MessageDigest |
getMessageDigest(java.lang.String algorithm) |
static byte[] |
getPrivateKey(java.lang.String secretPhrase) |
static byte[] |
getPublicKey(java.lang.String secretPhrase) |
static java.security.SecureRandom |
getSecureRandom() |
static byte[] |
getSharedSecret(byte[] myPrivateKey,
byte[] theirPublicKey) |
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 byte[] |
sign(byte[] message,
java.lang.String secretPhrase) |
static boolean |
verify(byte[] signature,
byte[] message,
byte[] publicKey,
boolean enforceCanonical) |
static void |
xorDecrypt(byte[] data,
int position,
int length,
byte[] myPrivateKey,
byte[] theirPublicKey,
byte[] nonce)
Deprecated.
|
static byte[] |
xorEncrypt(byte[] data,
int position,
int length,
byte[] myPrivateKey,
byte[] theirPublicKey)
Deprecated.
|
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 byte[] getPublicKey(java.lang.String secretPhrase)
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[] aesEncrypt(byte[] plaintext, byte[] myPrivateKey, byte[] theirPublicKey)
public static byte[] aesEncrypt(byte[] plaintext, byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)
public static byte[] aesDecrypt(byte[] ivCiphertext, byte[] myPrivateKey, byte[] theirPublicKey)
public static byte[] aesDecrypt(byte[] ivCiphertext, byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)
@Deprecated public static byte[] xorEncrypt(byte[] data, int position, int length, byte[] myPrivateKey, byte[] theirPublicKey)
@Deprecated public static void xorDecrypt(byte[] data, int position, int length, byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)
public static byte[] getSharedSecret(byte[] myPrivateKey, byte[] theirPublicKey)
public static java.lang.String rsEncode(long id)
public static long rsDecode(java.lang.String rsString)