@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }
@Override public String encode(String secret) throws Exception { char[] chars = secret.toCharArray(); byte[] salt = getSalt(); StringBuilder builder = new StringBuilder(); builder.append(iterations).append(SEPARATOR).append(ByteUtil.bytesToHex(salt)).append(SEPARATOR); PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength); byte[] hash = skf.generateSecret(spec).getEncoded(); String hexValue = ByteUtil.bytesToHex(hash); builder.append(hexValue); return builder.toString(); }