Skip to main content
added 195 characters in body
Source Link
user6181090
user6181090

I am trying to build an unofficial api for a website. It will require the user to log in, and the password will be read from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

Edit : I know how to convert a char array to string. The problem is that Strings are immutable and since you cannot delete objects explicitly in Java, the password will be left in the memory.

I am trying to build an unofficial api for a website. It will require the user to log in, and the password will be read from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

I am trying to build an unofficial api for a website. It will require the user to log in, and the password will be read from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

Edit : I know how to convert a char array to string. The problem is that Strings are immutable and since you cannot delete objects explicitly in Java, the password will be left in the memory.

added 26 characters in body
Source Link
user6181090
user6181090

I am trying to build an unofficial api for a website. The programIt will readrequire the user to log in, and the password will be read from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

I am trying to build an unofficial api for a website. The program will read the user password from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

I am trying to build an unofficial api for a website. It will require the user to log in, and the password will be read from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?

Source Link
user6181090
user6181090

Password security in Java - Converting char[] to String

I am trying to build an unofficial api for a website. The program will read the user password from the console using the standard Console.readPassword() method. Now, this gives me a char array, but I have to send the password through a POST request using the HttpPost class in Apache's HttpClient library. For this, a String is required, but conversion of the password to String will create a security risk. What can I do?