Here you can find the source of generateSalt()
public static String generateSalt()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String generateSalt() { StringBuilder builder = new StringBuilder(); Random random = new Random(); final char[] chars = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz+/1234567890".toCharArray(); for (int i = 0; i < 32; i++) { builder.append(chars[random.nextInt(chars.length)]); }/*from w ww.j a v a 2 s.c om*/ return builder.toString(); } }