### Question:
Crypto extends RapidoidThing { public static synchronized CryptoKey getSecretKey() { if (secretKey == null) { initSecret(); } U.notNull(secretKey, "secret key"); return secretKey; }  static void reset(); static MessageDigest digest(String algorithm); static Cipher cipher(String transformation); static String bytesAsText(byte[] bytes); static byte[] md5Bytes(byte[] bytes); static String md5(byte[] bytes); static String md5(String data); static byte[] sha1Bytes(byte[] bytes); static String sha1(byte[] bytes); static String sha1(String data); static byte[] sha512Bytes(byte[] bytes); static String sha512(byte[] bytes); static String sha512(String data); static synchronized CryptoKey getSecretKey(); static String randomStr(int byteCount); static byte[] encrypt(byte[] data, CryptoKey key); static byte[] decrypt(byte[] data, CryptoKey key); static byte[] encrypt(byte[] data); static byte[] decrypt(byte[] data); static byte[] pbkdf2(char[] password, byte[] salt, int iterations, int length); static String passwordHash(char[] password); static String passwordHash(char[] password, int iterations); static String passwordHash(char[] password, int iterations, byte[] salt); static boolean passwordMatches(char[] password, String saltedHash); static boolean passwordMatches(String password, String saltedHash); static byte[] randomBytes(int byteCount); static byte[] hmac(byte[] data, byte[] secret, byte[] salt); static boolean hmacMatches(byte[] hmac, byte[] data, byte[] secret, byte[] salt); static final SecureRandom RANDOM; }### Answer:
@Test public void testRandomSecret() { notNull(Crypto.getSecretKey()); neq(Str.toHex(Crypto.getSecretKey().encryptionKey), "3CDB902856D13CC88139DD290822DA99E85242F16E575E73ED7953208B88B045"); }
@Test public void testSpecifiedSecret() { Env.setArgs("secret=mysecret"); String key = Str.toHex(Crypto.getSecretKey().encryptionKey); String key1 = "DCE88CB5E440BC26D371D64E55DBB67832BBB44C2887BEE9C1DF17F88BC1764B"; String key2 = "3CDB902856D13CC88139DD290822DA99E85242F16E575E73ED7953208B88B045"; Set<String> keys = U.set(key1, key2, key1.substring(0, key1.length() / 2), key2.substring(0, key2.length() / 2)); }