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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,349)