Crypto algorithm list

I'm trying to find a list of strings that can be used a a crypto algorithm to fit into this function, replacing SHA256.

crypto.createHmac("SHA256", secret).update(string).digest('base64'),

I've come to the understanding that crypto uses openssl, and that the algorithms are specific to each system running node.js.

With the following commands you can see a list of all algorithms available for your system.

openssl list-cipher-algorithms 
openssl list-cipher-commands 

I've outputted the content of those two commands to this gist.

What bothers me is that SHA256 is not in either of those lists.

I would really like the definitive algorithm list.

Here is the definitive list : http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS

The openssl docs have a page listing all valid cipher strings: http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS

SHA-256 is not a cipher, it is a hash algorithm. That is probably why you didn't find it in a list of ciphers. The same goes for MD5 and all the various SHA algorithms.

Indeed, a hash algorithm is exactly what you need for HMAC. If you want to construct a MAC based on a block cipher, you'll need to use some other construction, such as OMAC/CMAC, PMAC or CBC-MAC.

I checked all of the cipher strings and everything in my gist and these are the only algo's that work with cipher to create a HMAC.

MD5
SHA
SHA1
SHA256
SHA384