java - using jpasswordfield safely to encrypt password -
okay not sure how else word title. basically, i'm being lazy , creating application log in website , fill out weekly timesheets me.
the app, creates local encrypted file stores login credentials website. have method setup takes passphrase , string, encrypts string using des using passphrase, , writes cipher text file. set login credentials use jtextfield username , jpasswordfield password. initially, built string out of these 2 , passed cipher method. however, jpasswordfield requires .getpassword() safety method encrypt fails, because requires string. i'm looking improve have.
cipher: public static void encrypt(string _passphrase, string _loginstring)
_loginstring => string loginstring = userfield.gettext() +"~"+ passfield.gettext()
so i'm looking improve using .getpassword(). suggestions? idea, yes amateur, build string char[] , use it, kind of defeats purpose of not using passfield.gettext(). btw fun exercise security , efficiency isn't required or needed.
Comments
Post a Comment