Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 11, 2017 2:00 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Decryption broke in 2012r2 and 2012r2.1
PostPosted: Mon Apr 29, 2013 2:32 pm 
Offline

Joined: Tue Apr 17, 2007 9:19 pm
Posts: 437
We just realized that RB2012r2 and RB2012r2.1 do NOT decrypt a Realsqldatabase. New bug I'm guessing and it shouldn't take long to validate. I attempted to post this through the Feedback system, but when I tried to run the Feedback in RB2012r2.1, it said it needed to download an update and couldn't find it. Is this because the RB website was hacked? Next, I tried to go to the RS website to access the Feedback system and it would not accept my login credentials. All in all, looks bad for RS if you can't report something like this ASAP because our applications suddenly can't decrypt their own data files. YIKES!

BTW, we confirmed that RB2012r1 and RB2012r1.1 both worked and will decrypt the database.

So how do we get a fix?


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1
PostPosted: Mon Apr 29, 2013 5:38 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
jjfcpa wrote:
We just realized that RB2012r2 and RB2012r2.1 do NOT decrypt a Realsqldatabase. New bug I'm guessing and it shouldn't take long to validate. I attempted to post this through the Feedback system, but when I tried to run the Feedback in RB2012r2.1, it said it needed to download an update and couldn't find it. Is this because the RB website was hacked? Next, I tried to go to the RS website to access the Feedback system and it would not accept my login credentials. All in all, looks bad for RS if you can't report something like this ASAP because our applications suddenly can't decrypt their own data files. YIKES!

BTW, we confirmed that RB2012r1 and RB2012r1.1 both worked and will decrypt the database.

So how do we get a fix?


I've not encountered any issues with encryption in the REALSQLDatabase in any edition - much less 2012r2 or 2.1

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1
PostPosted: Mon Apr 29, 2013 5:48 pm 
Offline

Joined: Tue Mar 23, 2010 8:44 pm
Posts: 673
I am not sure but something like this sounds familiar to me as. I have an older project which uses the encryption / decryption and sometimes the data is correctly shown in plain text after the decryption and sometimes it's not.

I post the data to a php script where I view it online. I became aware of the issue when apparently no reason (no code changes) it flip flops between clear text and encrypted text...

I can't say for sure what's going on because this is an older project and I haven't tackled that problem yet but this issue does sound a bit familiar to me although it could be my bug.

If I remember accurately I was having this issue using RS 2010 5.1.

I don't know if it will be the same in 2012 x.x.


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1
PostPosted: Tue Apr 30, 2013 7:48 am 
Offline

Joined: Tue Apr 17, 2007 9:19 pm
Posts: 437
No, this is a case where we have an application that is still running compiled with 2012r1.1 and the Realsqldatabase is encrypted. We attempted to run the project with 2012r2.1 and we get an error that the database can't be opened. As it turns out, the error is occurring because the db will not decrypt with the provided password.

We ran the project with 2012r1.1 and everything works fine. We further confirmed that using Sqlite Manager we can open the db with the correct password.

We verified this with another of our applications that also uses encryption - can be turned on or off. Same results.

I'm going to try and put together a sample file to send to RS so they can diagnose.


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1 [ SOLVED ]
PostPosted: Tue Apr 30, 2013 10:34 am 
Offline

Joined: Tue Apr 17, 2007 9:19 pm
Posts: 437
Ok, here is what we found.

If you attempted to open an encrypted realsqldatabase in a version of RB prior to 2012r2, then you would get an error 26 ( File is encrypted or is not a database ); however, if you try to open it with 2012r2 or later, you get an error 21 ( Library routine called out of sequence). So our problem was that the error we were checking for to know the file was encrypted was failing and our application would not attempt to pass the password to it because it didn't recognize the error code.

If we modify our applications to check for error 26 or error 21, then it works, but should it???


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1 [ SOLVED ]
PostPosted: Tue Apr 30, 2013 11:10 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
jjfcpa wrote:
Ok, here is what we found.

If you attempted to open an encrypted realsqldatabase in a version of RB prior to 2012r2, then you would get an error 26 ( File is encrypted or is not a database ); however, if you try to open it with 2012r2 or later, you get an error 21 ( Library routine called out of sequence). So our problem was that the error we were checking for to know the file was encrypted was failing and our application would not attempt to pass the password to it because it didn't recognize the error code.

If we modify our applications to check for error 26 or error 21, then it works, but should it???


Usually when I do this I dont try & target a specific error code.
I try without the password and if that fails try the encrypted.
The db engine (sqlite) source code may change, we don't control that, and it may be the source of the changed error code.
There are / were only 4 bug reports fixed in the engine between version 2012r1.2 and 2002r2 - none of which changed error codes that I can see.

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Decryption broke in 2012r2 and 2012r2.1 [ SOLVED ]
PostPosted: Tue Apr 30, 2013 12:12 pm 
Offline

Joined: Tue Apr 17, 2007 9:19 pm
Posts: 437
npalardy wrote:
jjfcpa wrote:
Ok, here is what we found.

If you attempted to open an encrypted realsqldatabase in a version of RB prior to 2012r2, then you would get an error 26 ( File is encrypted or is not a database ); however, if you try to open it with 2012r2 or later, you get an error 21 ( Library routine called out of sequence). So our problem was that the error we were checking for to know the file was encrypted was failing and our application would not attempt to pass the password to it because it didn't recognize the error code.

If we modify our applications to check for error 26 or error 21, then it works, but should it???


Usually when I do this I dont try & target a specific error code.
I try without the password and if that fails try the encrypted.
The db engine (sqlite) source code may change, we don't control that, and it may be the source of the changed error code.
There are / were only 4 bug reports fixed in the engine between version 2012r1.2 and 2002r2 - none of which changed error codes that I can see.



The problem may be the Realbasic documentation then, because if you look at the sqlite error codes here http://www.sqlite.org/c3ref/c_abort.html you note that error code 26 does not say anything about the file being encrypted; however, if you look in the LR, it states "File is encrypted or not a database". In the past, we just tried to connect without a password and if the error code was 26 we knew the file was encrypted. Obviously, that won't work anymore so we'll have to do as you suggested.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group