Encrypting & Decryption of information

7.1/ 7.2 is causing error, seems 7.0 is last working version in wappler

Recommendation now is to use openssl_encrypt as detailed in my earlier post, perhaps this could be integrated in to wappler @patrick as a replacement?

This is indeed something that needs to be updated, but have to be careful not to break current implementation since openssl encryption is different then the mcrypt encryption.

1 Like

Perhaps continue to offer both versions under different titles in the Crytographic menu ?

That will probably be the solution if we don’t find a way to decrypt the old mcrypt encrypted data, but prefer to just replace the old with the new encryption. Will do some tests, there are a lot of encryption methods in openssl, probably one is compatible with the old mcrypt.

3 Likes

You can do this.

Encrypt your data as required to the DB, to display use a repeater with a setvalue step inside the server action calling the data. Apply decrypt to the setvalue step and then on the page bind it, the data will then be displayed decrypted.

1 Like

Here’s the same thing discussed in another topic:

Hi Dave
The issue is not how to do it mechanically, the issue is which cryptographic method to use which is compatible with all versions of PHP. The inbuilt encrypt/decrypt with password doesn’t work after php v7.0

The method I have outlined works with all PHP versions, Wappler, and DMX Extensions Brian. Trust me we use this to store some information and all of our servers are running the latest versions of PHP. It is not using the inbuilt encrypt/decrypt with password.

How do you do that?

As you would when creating a users password. Form - Field - Import Form to Action - Apply SHA to the field on insert, encrypted.

But SHA is one way, can’t be decrypted?

Soon as I have time I will drop a video. It can be done.

Great if it can, thanks. I confess to being confused how to use SHA to encrypt at database level, store as encrypted and then decrypt later for use in app connect

Sorry my bad, this is using Encrypt with Password, and yes it works fine. See below:

Create Form:

Create Encrypt Action:

Create Decrypt Action:

Video:
ExampleVideo.mp4 (364.5 KB)

Database:
DatabaseText

Yes, it should work with password, just as explained in the topic i posted.

It is the SHA encryption method + salt cannot be “decrypted” :slight_smile:

1 Like

It was a while since I did this… Forgive my error :wink:

1 Like

So the server is running PHP 7.0 or older as mcrypt is now depreciated?

In this example is PHP 7.0 Brian. I’d have to go back and have a look on the other implementations (and possibly fix it for the client) as it has been a year or so. If it does not work it wouldn’t be hard to fix it. Quick search brings up lots of results:

Just so you are aware, as mcrypt is depreciated after 7.0, the wappler encrypt/ decrypt with password, which uses it, generates a server error after php 7.0.

I have tested it in 7.1,7.2 and 7.3 so it may not be that simple

Just seen you post, should work for those with dedicated servers and full access but not a universal wappler solution, we really need an open_ssl solution and keep up with the times

3 Likes