diff --git a/upassword b/upassword index 44faf34..44bd167 100755 --- a/upassword +++ b/upassword @@ -4898,17 +4898,17 @@ public class upassword { die(aeskeyfile + ": Refus d'écraser un fichier existant", null); } - String password = null; - if (args.length > 0) password = args[0]; - String salt = null; - if (args.length > 1) salt = args[1]; - byte[] key = null; try { + String password = null; + if (args.length > 0) password = args[0]; + byte[] salt = null; + if (args.length > 1) salt = args[1].getBytes(UTF_8); + if (password != null && salt != null) { key = AESEnc.genkey(); } else { - key = AESEnc.genkey(password, salt.getBytes(UTF_8), -1); + key = AESEnc.genkey(password, salt, -1); } } catch (Exception e) { die(null, e);