congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
jodd.crypt
Code IndexAdd Tabnine to your IDE (free)

How to use jodd.crypt

Best Java code snippets using jodd.crypt (Showing top 20 results out of 315)

origin: oblac/jodd

/**
 * Returns the {@link BCrypt} hash tool with given rounds number for salt generation.
 */
public static HashEngine bcrypt(final int rounds) {
  return bcrypt(BCrypt.gensalt(rounds));
}
origin: oblac/jodd

/**
 * Creates SHA-256 digest of a file.
 *
 * @param file {@link File} to create digest of.
 * @return SHA-256 digest of the {@link File}.
 */
public static String sha256(final File file) throws IOException {
  return DigestEngine.sha256().digestString(file);
}
origin: oblac/jodd

/**
 * Encrypts a block.
 */
@Override
public byte[] encryptBlock(final byte[] content, final int offset) {
  
  long[] contentBlock = bytesToLongs(content, offset, blockSizeInBytes);
  
  long[] encryptedBlock = new long[blockSize / Long.SIZE];
  blockEncrypt(contentBlock, encryptedBlock);
  return longsToBytes(encryptedBlock);
}
origin: oblac/jodd

@Override
public byte[] decryptBlock(final byte[] encryptedContent, final int offset) {
  long[] encryptedBlock = bytesToLongs(encryptedContent, offset, blockSizeInBytes);
  long[] decryptedBlock= new long[encryptedBlock.length];
  blockDecrypt(encryptedBlock, decryptedBlock);
  return longsToBytes(decryptedBlock);
}
origin: oblac/jodd

/**
 * Creates MD5 digest of a {@link File}.
 *
 * @param file {@link File} to create digest of.
 * @return MD5 digest of the {@link File}.
 */
public static String md5(final File file) throws IOException {
  return DigestEngine.md5().digestString(file);
}
origin: oblac/jodd

/**
 * Creates SHA-512 digest of a file.
 *
 * @param file {@link File} to create digest of.
 * @return SHA-512 digest of the {@link File}.
 */
public static String sha512(final File file) throws IOException {
  return DigestEngine.sha512().digestString(file);
}
origin: oblac/jodd

/**
 * Generate a salt for use with the BCrypt.hashpw() method,
 * selecting a reasonable default for the number of hashing
 * rounds to apply.
 *
 * @return an encoded salt value
 */
public static String gensalt() {
  return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS);
}
origin: oblac/jodd

  @Override
  public boolean check(final String input, final String hash) {
    return BCrypt.checkpw(input, hash);
  }
};
origin: oblac/jodd

@Override
public String hash(final String input) {
  return BCrypt.hashpw(input, salt);
}
origin: oblac/jodd

/**
 * Creates new SHA-1 digest.
 */
public static DigestEngine sha1() {
  return new JavaDigestEngine("SHA-1");
}
/**
origin: oblac/jodd

  @Override
  public boolean check(final String input, final String hash) {
    return pbkdf2Hash.validatePassword(input, hash);
  }
};
origin: oblac/jodd

  @Override
  public String decryptString(final byte[] encryptedContent) {
    return threefish.decryptString(encryptedContent);
  }
};
origin: oblac/jodd

@Override
public byte[] encryptString(final String input) {
  return threefish.encryptString(input);
}
origin: oblac/jodd

@Override
public String hash(final String input) {
  return pbkdf2Hash.createHash(input);
}
origin: oblac/jodd

public static long hashCode(final long k0, final long k1, final byte[] data) {
  return hash24(k0, k1, data);
}
origin: oblac/jodd

/**
 * Creates new SHA-384 digest.
 */
public static DigestEngine sha384() {
  return new JavaDigestEngine("SHA-384");
}
/**
origin: oblac/jodd

/**
 * Creates new MD2 digest.
 */
public static DigestEngine md2() {
  return new JavaDigestEngine("MD2");
}
/**
origin: oblac/jodd

/**
 * Creates new SHA-256 digest.
 */
public static DigestEngine sha256() {
  return new JavaDigestEngine("SHA-256");
}
/**
origin: oblac/jodd

/**
 * Creates new MD5 digest.
 */
public static DigestEngine md5() {
  return new JavaDigestEngine("MD5");
}
/**
origin: oblac/jodd

/**
 * Creates new SHA-512 digest.
 */
public static DigestEngine sha512() {
  return new JavaDigestEngine("SHA-512");
}
jodd.crypt

Most used classes

  • BCrypt
    BCrypt implements OpenBSD-style Blowfish password hashing using the scheme described in "A Future-Ad
  • DigestEngine
    Digest engines.
  • HashEngine
    Hash engines.
  • MurmurHash3
    MurmurHash3 128bits. Adaptation of http://github.com/yonik/java_util for future updates to this file
  • PBKDF2Hash
  • Threefish,
  • BlockCipher,
  • DigestEngine$JavaDigestEngine,
  • MurmurHash3$HashValue,
  • PBKDF2Encryptor,
  • BlockCipherTest$FooBlockCipher,
  • CryptoEngine
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now