Android Question Encrypt MSSQL login credentials

Mostez

Well-Known Member
Licensed User
Longtime User
my program connects to SQL 2012 server, I'd like to know if login credentials are encrypted by B4A or just sent in raw text format? is there any method to encrypt it?
 

Alex_197

Well-Known Member
Licensed User
Longtime User
Which way are you going to connect? What if you create ASP.NET / PHP page that will connect to your app and send the data to the SQL Server?
In this way you don't need to care about security at all.
 
Upvote 0

Mostez

Well-Known Member
Licensed User
Longtime User
I never designed ASP.NET projects, i just use B4X activities to send sql queries and display data on b4xtables
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
Hello, it is not clear what database you are connecting to, Whether it is SQL or MYSQL server database. If you write about a server database, you can use JRDC2. It is fully encrypted.

Here's SQL
 
Last edited:
Upvote 0

Mostez

Well-Known Member
Licensed User
Longtime User
it is not clear what database you are connecting to
it is in my first post and title MS SQL 2012 Server. what I did not mention is "I use jtds-1.3.1 for connection", is it possible to use SQLCipher with it?
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
SQLCipher is not a server solution. You need a solution for a server base, in this role JRDC2 works best ... both locally and remotely via the Internet and the data is encrypted ...

P.S
Sorry ... the title contains a kind of database ...
 
Last edited:
Upvote 0

Mostez

Well-Known Member
Licensed User
Longtime User
I created SSL certificate and assigned it to SQL server, server services started OK and i can login to server from application, I added SSL option to jtds like this:
B4X:
dbJDBCurl = "jdbc:jtds:sqlserver://" & dbCurrentIP & "/" & dbName & ";ssl = request"

I monitored the packets sent from phone to server, but I still see username and password in plain text and protocol is TDS not SSL
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I monitored the packets sent from phone to server, but I still see username and password in plain text and protocol is TDS not SSL
How are you monitoring the packets? The client should first create an SSL connection to the server and then use TDS over SSL to communicate with the server.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
The SSL connection to the SQL server should happen before the TDS connection. In Wireshark, you should see the client establish the SSL connection to the server and, if successful, all traffic to the server should be encrypted. If that is not happening, you may need to look at the log files on the server to see what is going on.
 
Upvote 0

Mostez

Well-Known Member
Licensed User
Longtime User
sorry for delay, please see attached screen capture
 

Attachments

  • Image1.png
    Image1.png
    96.2 KB · Views: 167
Upvote 0
Top