Hello good day. I have a quick question is anyone able to assist me in saving a password file. I encrypted my password and so I want to save the salt and the encrypted password(which are byte arrays). I tried using a properties file, but I soon found out that I can't. Can anyone assist me in saving these byte arrays and retrieving them please?
CoilFyzx
0
Newbie Poster
Recommended Answers
Jump to PostYou could convert them to Strings (eg in hex) then there's no problem with properties files.
Jump to PostTry javax.xml.bind.DatatypeConverter (Java SE 6 or later)
That has printBase64Binary and parseBase64Binary methods to convert byte[] to printable String and back again, egbyte[] b = {(byte) 99, (byte) -101}; String s = javax.xml.bind.DatatypeConverter.printBase64Binary(b); System.out.println(s); byte[] b1 = javax.xml.bind.DatatypeConverter.parseBase64Binary(s); System.out.println(Arrays.toString(b1));
All 5 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
CoilFyzx
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
CoilFyzx
0
Newbie Poster
CoilFyzx
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.