Hi,
I am planning to implement a small tool that will encrypt large numbers of files and I find the AES file format used in AESCrypt suitable for my needs - I see no reason to reinvent the wheel there.
Anyway, all is clear to me except one thing, the HMAC.
In another thread here on the forum there is a link to Wikipedia regarding the HMAC, but that page lists "examples of HMAC" using MD5, SHA1 and SHA256. RFC 2104 also states that any iterative hash algorithm can be used.
Given the length of the HMAC fields in the file format, is SHA256 the only algorithm that can be used (HMAC-SHA-256)?
What algorithm for HMAC?
- paulej
- Posts: 593
- Joined: Sun Aug 23, 2009 7:32 pm
- Location: Research Triangle Park, NC, USA
- Contact:
Re: What algorithm for HMAC?
HMAC can be used with any kind of hash. It's a fairly simple algorithm:
Any hash function could be used, but AES Crypt only uses SHA256. Look at the Linux source code for the most straight-forward and readable example usage.
Code: Select all
H(K XOR opad, H(K XOR ipad, text))
Re: What algorithm for HMAC?
OK, thanks for the info - I'll have a look att the Linux implementation.
I'm going to use C# and .NET for my Windows app, hopefully the HMACSHA256 class does the same thing as the Aescrypt HMAC implementation. (http://msdn.microsoft.com/en-us/library ... ha256.aspx)
I'm going to use C# and .NET for my Windows app, hopefully the HMACSHA256 class does the same thing as the Aescrypt HMAC implementation. (http://msdn.microsoft.com/en-us/library ... ha256.aspx)