cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cymorg1
Advocate I
Advocate I

Can we use Cryptography in Flows?

I have the following C# code in a .NET application I'd like to do the same thing in a Power Automate Flow.

Is that possible?

private string GetSignature(string signtext, string privateKey)
{
	System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
	byte[] keybytes = encoding.GetBytes(privateKey);
	byte[] signbytes = encoding.GetBytes(signtext);
	HMACSHA256 hmacsha256 = new HMACSHA256(keybytes);
	return EncodeTo64(ByteToString(hmacsha256.ComputeHash(signbytes)).ToLower());
}		
private string EncodeTo64(string toEncode)
{
	byte[] toEncodeAsBytes	= System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);
	string returnValue		= System.Convert.ToBase64String(toEncodeAsBytes);
	return returnValue;
}

The HMACSHA256 class is in the .NET System.Security.Cryptography namespace.

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @cymorg1 

 

There is a third party connector available for HMAC encryption. Please have a look at this.

 

Solved: Encrypting an API request with base64url and HmacS... - Power Platform Community (microsoft....

 

@Jay-Encodian  could help you here.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @cymorg1 

 

There is a third party connector available for HMAC encryption. Please have a look at this.

 

Solved: Encrypting an API request with base64url and HmacS... - Power Platform Community (microsoft....

 

@Jay-Encodian  could help you here.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

askondo
Community Support
Community Support

@abm Thank you for all your contributions to the forum. I appreciate it very much.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,346)