Package nxt.crypto
Class Crypto
- java.lang.Object
-
- nxt.crypto.Crypto
-
public final class Crypto extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 voidcurve(byte[] Z, byte[] k, byte[] P)static byte[]getKeySeed(java.lang.String secretPhrase, byte[]... nonces)static java.security.MessageDigestgetMessageDigest(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.SecureRandomgetSecureRandom()static byte[]getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey)static byte[]getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)static booleanisCanonicalPublicKey(byte[] publicKey)static booleanisCanonicalSignature(byte[] signature)static java.security.MessageDigestripemd160()static longrsDecode(java.lang.String rsString)static java.lang.StringrsEncode(long id)static java.security.MessageDigestsha256()static java.security.MessageDigestsha3()static byte[]sign(byte[] message, java.lang.String secretPhrase)static booleanverify(byte[] signature, byte[] message, byte[] publicKey)
-
-
-
Method Detail
-
getSecureRandom
public static java.security.SecureRandom getSecureRandom()
-
getMessageDigest
public static java.security.MessageDigest getMessageDigest(java.lang.String algorithm)
-
sha256
public static java.security.MessageDigest sha256()
-
ripemd160
public static java.security.MessageDigest ripemd160()
-
sha3
public static java.security.MessageDigest sha3()
-
getKeySeed
public static byte[] getKeySeed(java.lang.String secretPhrase, byte[]... nonces)
-
getPublicKey
public static byte[] getPublicKey(byte[] keySeed)
-
getPublicKey
public static byte[] getPublicKey(java.lang.String secretPhrase)
-
getPrivateKey
public static byte[] getPrivateKey(byte[] keySeed)
-
getPrivateKey
public static byte[] getPrivateKey(java.lang.String secretPhrase)
-
curve
public static void curve(byte[] Z, byte[] k, byte[] P)
-
sign
public static byte[] sign(byte[] message, java.lang.String secretPhrase)
-
verify
public static boolean verify(byte[] signature, byte[] message, byte[] publicKey)
-
getSharedKey
public static byte[] getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey)
-
getSharedKey
public static byte[] getSharedKey(byte[] myPrivateKey, byte[] theirPublicKey, byte[] nonce)
-
aesEncrypt
public static byte[] aesEncrypt(byte[] plaintext, byte[] key)
-
aesGCMEncrypt
public static byte[] aesGCMEncrypt(byte[] plaintext, byte[] key)
-
aesDecrypt
public static byte[] aesDecrypt(byte[] ivCiphertext, byte[] key)
-
aesGCMDecrypt
public static byte[] aesGCMDecrypt(byte[] ivCiphertext, byte[] key)
-
rsEncode
public static java.lang.String rsEncode(long id)
-
rsDecode
public static long rsDecode(java.lang.String rsString)
-
isCanonicalPublicKey
public static boolean isCanonicalPublicKey(byte[] publicKey)
-
isCanonicalSignature
public static boolean isCanonicalSignature(byte[] signature)
-
-