cancel
Showing results for 
Search instead for 
Did you mean: 

Function to encrypt hash(sha512, sha1, sha256, MD5)

Hi.

 

Enable a function to be able to insert an encrypted password to SQL Server (or other server) and when consulting in the database option to decrypt in the same way.

Example:

Insert into SQL Server

Set(password,hash('sha512',Input_Text.Text));

 

Query in SQL Server from PowerApps

If(hash('sha512',Input_Text.Text)=Row[Table_SQL],Notify('Correct',Success),Notify('Wrong',Error);

 

Regards.

Jesús Aguirre

Status: New
Comments
Lucian
Advocate II

Hi guys,

 

And thank you, both of you for your time, because your answers helped me a lot.

Now I have another problem with this "write code only" solution. This was working perfectly on 2 of the tenants, and on a third one, and of course the "most important" one 😁 the Hash step will run for 5 or 10 minutes instead of 0-1 second.

It will return the proper result but is taking too much time (they have 1 or 2 retries).

What could cause such a bad performance? Or for this kind of problem should I open a case to Microsoft Support?

 

Kind Regards,
Lucian 

ValentinGasenko
Frequent Visitor

Hi @Lucian 


It's not entirely clear how this can work for so long. In theory, there is a limit of five seconds for a block of code.
Does your connector work quickly without a code, and with a code - five-ten minutes?
Or I misunderstood you. Explain more clearly and preferably attach a connector/block of executable code.

Lucian
Advocate II

Hi @ValentinGasenko ,

 

The flow is pretty simple: put some text into a string variable, run the hash function and get the result.

 

Hash-Steps.png

 

I have used this setup just to be as closest as possible to the real flow that will use an "Apply to each" loop.

 

It seems that the Hash step had some retries:

 

Hash-Detail.png

The problem seems to be caused by the "5 second" limit:

Hash-Error.png

 

Meanwhile, it seems like something was unlocked or "provisioned" because on the last test the flow was running very fast from 10 minutes, to 7 ms 😊:

 

Hash-Runs.png

 

I think it was just a "glitch in the matrix".

 

Thank you!

 

Kind Regards,

Lucian

ValentinGasenko
Frequent Visitor

@Lucian 

Interesting case. If I were you, I would have sent it into the issue report for the MS.
And, of course, this functionality is still in the preview. Be careful.

Heavier, but safer to use the azure function.