Java Salt Value Create generateSaltAESPBKDF2()

Here you can find the source of generateSaltAESPBKDF2()

Description

This method is used for generate slat

License

Open Source License

Parameter

Parameter Description
String a parameter

Exception

Parameter Description
Exception an exception

Return

String

Declaration

public static String generateSaltAESPBKDF2() 

Method Source Code

//package com.java2s;
/**/*from w  ww .ja va  2 s  .c o  m*/
 * Copyright (C) 2013 Company. All Rights Reserved. 
 * 
 * This software is the proprietary information of Company . 
 * Use is subjected to license terms. 
 *
 * @since Jul 14, 2013 8:27:33 PM
 * @author SPA
    
 *
 */

import java.security.SecureRandom;

public class Main {
    /**
     * 
     * This method is used for generate slat
     * 
     * @param String
     * @return String
     * @throws Exception
     */
    public static String generateSaltAESPBKDF2() {
        SecureRandom random = new SecureRandom();
        byte bytes[] = new byte[20];
        random.nextBytes(bytes);
        return new String(bytes);
    }
}

Related

  1. generateSalt(int bits)
  2. generateSalt(int byteSize)
  3. generateSalt(int length)
  4. generateSalt(int numberOfBytes)
  5. generateSalt(int numBytes)
  6. generateSaltedPassword(final String password, byte[] salt, int iterationsCount, String hmacName)
  7. generateSaltedSHAHash(String algorithm, String input, String salt)
  8. generateSaltOfLength(int length)
  9. getMd5Salt()