This topic is locked

Encryption Question

4/18/2017 6:31:50 PM
PHPRunner General questions
T
thudsen author

I'm using MSSQL Azure Server and have finally (after a year) completed my project.
I've now set the database fields to encryption (Database based AES-128) and have come across a problem. The encrypted fields appear as chinese characters which I guess it is part of the algorithm and PHPR nice converts them back. However, any field I have which is encrypted will not store any more than 30 characters (including spaces) - this is true for nvarchar and varchar fields set to max.
I cannot work out if this is a server issue with MS Azure or if its the AES not functioning correctly.
Any ideas would be appreciated!
Thanks
Terry

admin 4/19/2017

My suggestion will be to try running this app on another server just to see if it works there. This way you can figure out if this is an app issue or a server issue.

T
thudsen author 4/25/2017



My suggestion will be to try running this app on another server just to see if it works there. This way you can figure out if this is an app issue or a server issue.


I've run the same (and other apps on the same and different MSSQL server) and get the same issue.
I've managed to discuss with MS and it is quite common for MSSQL to truncate nvarchar and varchar. I have specified these fields as (max) so there is plenty of room, but they say that encrypted values are stored as a binary value and the CONVERT statement is not specifying the NVARCHAR length to use so it's using the default NVARCHAR(30).
I can't find a convert statement in the PHP code and the built in SQL query won't accept one.
Any ideas? I could use code based encryption but I would lose the power to perform searches.
Thanks

admin 4/25/2017

Try to reproduce this error on Demo Account and if it can be reproduced there open a ticket with support team.

A
amins 6/20/2017



I'm using MSSQL Azure Server and have finally (after a year) completed my project.
I've now set the database fields to encryption (Database based AES-128) and have come across a problem. The encrypted fields appear as chinese characters which I guess it is part of the algorithm and PHPR nice converts them back. However, any field I have which is encrypted will not store any more than 30 characters (including spaces) - this is true for nvarchar and varchar fields set to max.
I cannot work out if this is a server issue with MS Azure or if its the AES not functioning correctly.
Any ideas would be appreciated!
Thanks
Terry



In phprunner>go to Tables>and change field type from varchar to mediumtext.

Then Sync database and build.