mercredi 3 décembre 2014

Char array Vs Byte array which one to use?


Vote count:

0




I was passing sensitive information (between my app and backend) like password in String format. Later on I realized that password can be easily read from heap memory dump as it is stored in text format.



String password = "super_password";


So I decided to use Char array,



Char[] passChar = password.toCharArray();


but I am worried that password can still be read from memory dump character by character. Then I thought of using byte array instead.



byte[] passByte = password.getBytes();


My question: Is it safe to use byte array for passing sensitive information like password ? OR can anyone recommend anything secure ?


Thanks in advance



asked 13 secs ago







Char array Vs Byte array which one to use?

Aucun commentaire:

Enregistrer un commentaire