cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cymorg1
Helper I
Helper 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 III
Super User III

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 III
Super User III

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
Microsoft
Microsoft

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

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (44,953)