Encrypting & Decryption of information

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

2 Likes

Sure, we will improve this :slight_smile:

2 Likes

I’m already working on an update, I just found a way with openssl that is compatible with the old mcrypt encryption and going to replace it.

6 Likes

crypto.zip (539 Bytes)

For who don’t want to wait and test the updated code. Replace the old file in dmxConnectLib/lib/formatters.

5 Likes

Now that’s what i call fast!

Will check it out after webinar and feed back

1 Like

OK, couldn’t wait, tested up to php 7.3, works correctly. Haven’t been able to check against old data though as I don’t have anything old that used this component

2 Likes

Thank you Patrick!

Is there a chance this could be included in a future update of Wappler?