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

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 blog
Power 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 blog
Power Automate Video Tutorials

askondo
Community Support
Community Support

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

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,757)