Changeset 682


Ignore:
Timestamp:
02/27/10 19:37:54 (6 months ago)
Author:
max
Message:

pub user password is now generated with characters from 33 to 126 which is more secured than before either avoid encoding problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/com/calenco/security/SUSecurityManager.java

    r680 r682  
    6969            pubuser.setName("Special User Running Publications"); // NOI18N 
    7070            SecureRandom rng = new SecureRandom(); 
    71             pubPass = new BigInteger(130, rng).toString(36); 
    72             /*byte[] passBytes = new byte[20]; 
    73             rng.nextBytes(passBytes); 
    74             pubPass = new String(passBytes);*/ 
     71            char[] chars = new char[15]; 
     72            for (int i = 0; i < 15; i++) { 
     73                chars[i] = (char) (rng.nextInt(93) + 33); 
     74            } 
     75            pubPass = new String(chars); 
    7576            pubuser.setPassword(pubPass); 
    7677            pubuser = new UserDAO(session).addOrUpdate(pubuser); 
Note: See TracChangeset for help on using the changeset viewer.