| Modifier and Type | Field and Description |
|---|---|
static SecureRandom |
RANDOM |
| Constructor and Description |
|---|
Crypto() |
| Modifier and Type | Method and Description |
|---|---|
static String |
bytesAsText(byte[] bytes) |
static Cipher |
cipher(String transformation) |
static byte[] |
decrypt(byte[] data) |
static byte[] |
decrypt(byte[] data,
byte[] secret) |
static MessageDigest |
digest(String algorithm) |
static byte[] |
encrypt(byte[] data) |
static byte[] |
encrypt(byte[] data,
byte[] secret) |
static byte[] |
getSecretKey() |
static String |
md5(byte[] bytes) |
static String |
md5(String data) |
static byte[] |
md5Bytes(byte[] bytes) |
static String |
passwordHash(String password) |
static String |
passwordHash(String password,
int iterations) |
static String |
passwordHash(String password,
int iterations,
byte[] salt) |
static boolean |
passwordMatches(String password,
String saltedHash) |
static byte[] |
pbkdf2(String password) |
static byte[] |
pbkdf2(String password,
byte[] salt,
int iterations,
int length) |
static byte[] |
randomBytes(int byteCount) |
static byte[] |
randomSalt() |
static String |
randomStr(int byteCount) |
static void |
reset() |
static String |
sha1(byte[] bytes) |
static String |
sha1(String data) |
static byte[] |
sha1Bytes(byte[] bytes) |
static String |
sha512(byte[] bytes) |
static String |
sha512(String data) |
static byte[] |
sha512Bytes(byte[] bytes) |
public static final SecureRandom RANDOM
public static void reset()
public static MessageDigest digest(String algorithm)
public static String bytesAsText(byte[] bytes)
public static byte[] md5Bytes(byte[] bytes)
public static String md5(byte[] bytes)
public static byte[] sha1Bytes(byte[] bytes)
public static String sha1(byte[] bytes)
public static byte[] sha512Bytes(byte[] bytes)
public static String sha512(byte[] bytes)
public static byte[] getSecretKey()
public static byte[] randomBytes(int byteCount)
public static String randomStr(int byteCount)
public static byte[] encrypt(byte[] data,
byte[] secret)
public static byte[] decrypt(byte[] data,
byte[] secret)
public static byte[] encrypt(byte[] data)
public static byte[] decrypt(byte[] data)
public static byte[] pbkdf2(String password, byte[] salt, int iterations, int length)
public static byte[] pbkdf2(String password)
public static byte[] randomSalt()
Copyright © 2014–2016 Nikolche Mihajlovski and contributors. All rights reserved.