android - Cipher AES, no error exception, but init not works -
i try cipher outputs after "cipher.init" won't output. no exceptions..and don't know why...(new on android)
public void login() { logindata logindata = this.fragmentbox.getupdatedlogindata(); string finishstring = new string(); try { cipher cipher = cipher.getinstance("aes"); byte[] output = null; secretkeyspec secretkey = new secretkeyspec( globals.encryptpw.getbytes(), "aes"); system.out.println(secretkey.getencoded().tostring() + "----" + globals.encryptpw); cipher.init(cipher.encrypt_mode, secretkey); output = cipher.dofinal(logindata.getpassword().getbytes()); byte[] encryptedusernamestring = base64.encode(output, 0); finishstring = new string(encryptedusernamestring, "utf-8"); } catch (invalidkeyexception e) { e.getstacktrace(); log.v("fehler im code",""); } catch(exception e){} system.out.println("code: " + finishstring); }
any idea?
Comments
Post a Comment