var YourCryptoKey = '';
// Change the value for the algo notes
var setKeyNotes = function(algo){
// Source: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API/Supported_algorithms
if(algo == 'AES-CBC')
document.getElementById("AlgorithmNotes").value = 'AES-CBC: Key usages for keys generated with this method are restricted to "encrypt", "decrypt", "wrapKey" or "unwrapKey". Key length must be 128, 192 or 256 bits.';
else if(algo == 'AES-CTR')
document.getElementById("AlgorithmNotes").value = 'AES-CTR: Key usages for keys generated with this method are restricted to "encrypt", "decrypt", "wrapKey" or "unwrapKey". Key length must be 128, 192 or 256 bits.';
else if(algo == 'AES-GCM')
document.getElementById("AlgorithmNotes").value = 'AES-GCM: Key usages for keys generated with this method are restricted to "encrypt", "decrypt", "wrapKey" or "unwrapKey". Key length must be 128, 192 or 256 bits.';
else if(algo == 'RSA-OAEP')
document.getElementById("AlgorithmNotes").value = 'RSA-OAEP: Key usages for keys generated with this method are restricted to "encrypt", "decrypt", "wrapKey" or "unwrapKey". Requires a HashAlgorithmIdentifier with the hash algorithm to use, instead of a key length.';
else if(algo == 'AES-KW')
document.getElementById("AlgorithmNotes").value = 'AES-KW: Key usages for keys generated with this method are restricted to "wrapKey" or "unwrapKey". Key length must be 128, 192 or 256 bits.';
else if(algo == 'HMAC')
document.getElementById("AlgorithmNotes").value = 'HMAC: Key usages for keys generated with this method are restricted to "sign" or "verify". Also requires a HashAlgorithmIdentifier, the hash algorithm to use. Key length must be an optional positive integer indicating the size of the key to generate. If not provided, the size of the block of the hash function is used.';
else if(algo == 'RSASSA-PKCS1-v1_5')
document.getElementById("AlgorithmNotes").value = 'RSASSA-PKCS1-v1_5: Key usages for keys generated with this...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.