Skip to content

Instantly share code, notes, and snippets.

View rameshbaskar's full-sized avatar

Ramesh Baskarasubramanian rameshbaskar

View GitHub Profile
@rameshbaskar
rameshbaskar / JavaCryptoTest.java
Created March 18, 2020 06:00
Java - Cryptography Example
import static org.springframework.security.crypto.bcrypt.BCrypt.hashpw;
import static org.springframework.security.crypto.bcrypt.BCrypt.gensalt;
import static org.springframework.security.crypto.bcrypt.BCrypt.checkpw;
public class CryptoTest {
public static void main(String[] args) {
String plainText = "Password123";
String hash = hashpw(plainText, gensalt(12));
if (checkpw(plainText, hash)) {
System.out.println("Hashing verified.");