This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
®‼⁉™ℹ↔↕↖↗↘↙↩↪⌚⌛⌨⏏⏩⏪⏫⏬⏭⏮⏯⏰⏱⏲⏳▪▫▶◀◻◼◽◾☀☁☂☃☄☎☑☔☕☘☝☠☢☣☦☪☮☯☸☹☺♀♂♈♉♊♋♌♍♎♏♐♑♒♓♟♠♣♥♦♨♻♾♿⚒⚓⚔⚕⚖⚗⚙⚛⚜⚠⚡⚪⚫⚰⚱⚽⚾⛄⛅⛈⛎⛏⛑⛓⛔⛩⛪⛰⛱⛲⛳⛴⛵⛷⛸⛹⛹️♀️⛹️♂️⛺⛽✂✅✈✉✊✋✌✍✏✒✔✖✝✡✨✳✴❄❇❌❎❓❔❕❗❣❤➕➖➗➡➰➿⤴⤵⬅⬆⬇⬛⬜⭐⭕〰〽🌀🌁🌂🌃🌄🌅🌆🌇🌈🌉🌊🌋🌌🌍🌎🌏🌐🌑🌒🌓🌔🌕🌖🌗🌘🌙🌚🌛🌜🌝🌞🌟🌠🌰🌱🌲🌳🌴🌵🌶🌷🌸🌹🌺🌻🌼🌽🌾🌿🍀🍁🍂🍃🍄🍅🍆🍇🍈🍉🍊🍋🍌🍍🍎🍏🍐🍑🍒🍓🍔🍕🍖🍗🍘🍙🍚🍛🍜🍝🍞🍟🍠🍡🍢🍣🍤🍥🍦🍧🍨🍩🍪🍫🍬🍭🍮🍯🍰🍱🍲🍳🍴🍵🍶🍷🍸🍹🍺🍻🍼🎀🎁🎂🎃🎄🎅🎆🎇🎈🎉🎊🎋🎌🎍🎎🎏🎐🎑🎒🎓🎠🎡🎢🎣🎤🎥🎦🎧🎨🎩🎪🎫🎬🎭🎮🎯🎰🎱🎲🎳🎴🎵🎶🎷🎸🎹🎺🎻🎼🎽🎾🎿🏀🏁🏂🏃🏃♀️🏃♂️🏄🏄♀️🏄♂️🏅🏆🏇🏈🏉🏊🏊♀️🏊🏠🏡🏢🏣🏤🏥🏦🏧🏨🏩🏪🏫🏬🏭🏮🏯🏰🌈☠️🐀🐁🐂🐃🐄🐅🐆🐇🐈🐉🐊🐋🐌🐍🐎🐏🐐🐑🐒🐓🐔🐕🐖🐗🐘🐙🐚🐛🐜🐝🐞🐟🐠🐡🐢🐣🐤🐥🐦🐧🐨🐩🐪🐫🐬🐭🐮🐯🐰🐱🐲🐳🐴🐵🐶🐷🐸🐹🐺🐻🐼🐽🐾👀👂👃👄👅👆👇👈👉👊👋👌👍👎👏👐👑👒👓👔👕👖👗👘👙👚👛👜👝👞👟👠👡👢👣👤👥👦👧👨👨⚕️👨⚖️👨✈️👨❤️👨👨❤️💋👨👨🌾👨🍳👨🎓👨🎤👨🎨👨🏫👨🏭👫👬👭👮👮♀️👮♂️👯👯♀️👯♂️👰👱👱♀️👱♂️👲👳👳♀️👳♂️👴👵👶👷👷♀️👷♂️👸👹👺👻👼👽👾👿💀💁💁♀️💁♂️💂💂♀️💂♂️💃💄💅💆💆♀️💆♂️💇💇♀️💇♂️💈💉💊💋💌💍💎💏💐💑💒💓💔💕💖💗💘💙💚💛💜💝💞💟💠💡💢💣💤💥💦💧💨💩💪💫💬💭💮💯💰💱💲💳💴💵💶💷💸💹💺💻💼💽💾💿📀📁📂📃📄📅📆📇📈📉📊📋📌📍📎📏📐📑📒📓📔📕📖📗📘📙📚📛📜📝📞📟📠📡📢📣📤📥📦📧📨📩📪📫📬📭📮📯📰📱📲📳📴📵📶📷📹📺📻📼🔀🔁🔂🔃🔄🔅🔆🔇🔈🔉🔊🔋🔌🔍🔎🔏🔐🔑🔒🔓🔔🔕🔖🔗🔘🔙🔚🔛🔜🔝🔞🔟🔠🔡🔢🔣🔤🔥🔦🔧🔨🔩🔪🔫🔬🔭🔮🔯🔰🔱🔲🔳🔴🔵🔶🔷🔸🔹🔺🔻🔼🔽🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧♀️♂️🗻🗼🗽🗾🗿😀😁😂😃😄😅😆😇😈😉😊😋😌😍😎😏😐😑😒😓😔😕😖😗😘😙😚😛😜😝😞😟😠😡😢😣😤😥😦😧😨😩😪😫😬😭😮😯😰😱😲😳😴😵😶😷😸😹😺😻😼😽😾😿🙀🙅🙅♀️🙅♂️🙆🙆♀️🙆♂️🙇🙇♀️🙇♂️🙈🙉🙊🙋🙋♀️🙋♂️🙌🙍🙍♀️🙍♂️🙎🙎♀️🙎♂️🙏🚀🚁🚂🚃🚄🚅🚆🚇🚈🚉🚊🚋🚌🚍🚎🚏🚐🚑🚒🚓🚔🚕🚖🚗🚘🚙🚚🚛🚜🚝🚞🚟🚠🚡🚢🚣🚣♀️🚣♂️🚤🚥🚦🚧🚨🚩 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copy(str){ | |
var inp = document.createElement("textarea"); | |
inp.style.position="fixed"; | |
document.body.appendChild(inp); | |
inp.value=str; | |
inp.select(); | |
document.execCommand("Copy"); | |
inp.remove(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hashCrypt(key, plain, hasher, workFactor=1) { // hasher is any sync string-output hash function | |
var len=plain.length, keyLen = key.length, keyOrig = key, | |
// calculate derivation count based on deterministic factors from the inputs: | |
mx = hasher(key).split("").map((a, b)=> a.charCodeAt(0) + b).reduce((a, b)=> a + b, 0) * workFactor; | |
// derive firstly for some hardness using cpu and ram hungry calculations: | |
for(let i = 0; i < mx; i++) key = hasher(key.repeat( ((i+len) % ((workFactor || 1) * 4))+1 )); | |
// expand key to needed length by appending re-hashing (with counters): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// public domain, based on https://www.schneier.com/blog/archives/2014/10/spritz_a_new_rc.html | |
function spritzStream(chars, iv) { | |
var s = [], key=iv || (Date.now() / (performance.now()*1000)).toString(36) + (chars/Math.random()), | |
j = 0, | |
w = 17, | |
k = 0, | |
res = [], | |
l = Math.ceil(key.length/2), | |
m = chars, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rc4stream(chars, iv) { | |
var s = [], key=iv || (Date.now() / (performance.now()*1000)).toString(36) + (chars/Math.random()), | |
j = 0, | |
x, res = [], | |
i, j, y, l = key.length, | |
m = Math.ceil(chars/2); | |
for(i = 0; i < 256; i++) s[i] = i; | |
for(i = 0; i < 256; i++) { | |
j = (j + s[i] + key.charCodeAt(i % l)) % 256; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stream(chars, iv){ // requires https://github.com/emn178/js-sha3/ | |
var buff="", i=0; | |
iv= sha3_512(iv || (Date.now() / (performance.now()*1000)).toString(36) + (chars/Math.random())); | |
while(buff.length < chars) buff+= iv = sha3_256(++i + iv); | |
return buff.slice(0, chars); | |
} | |
//ex: | |
// stream(500, "this is not a great iv"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nonce(chars){ | |
var b="", round, last; | |
while(true){ | |
var round= (Date.now() / (performance.now()*1000)).toString(36).split(".").pop().slice(2, -2); | |
if(round!=last) b+= round; | |
if(b.length > chars) break; | |
last=round; | |
} | |
return b.slice(-chars); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* password derivation that forces a re-creation of this routine by making slight mods to a normal hash-based kdf: | |
requires https://github.com/emn178/js-sha3 | |
Example timings on a i7 in chrome: | |
cost ms | |
1 - 108 | |
2 - 408 | |
3 - 1067 | |
4 - 2351 | |
5 - 3927 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSnapshot(callback) { | |
"use strict"; | |
callback = callback || Boolean; | |
var canvas = document.createElement("canvas"), | |
ctx = canvas.getContext("2d"), | |
webkit = false, | |
moz = false, | |
v = null, | |
W = 800, | |
H = 600, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function salad(numbers) { // word salad function for making (hopefully) human-memorable hashes for 64 digit strings (adapt as needed) | |
var r = "ability|able|about|above|accept|access|according|account|achieve|across|act|action|activity|actually|add|addition|admit|advantage|advice|affair|affect|after|again|against|age|ago|agree|agreement|air|all|allow|almost|along|already|also|although|always|among|amount|analysis|and|animal|announce|another|answer|any|anyone|anything|anyway|appear|application|apply|approach|appropriate|area|argue|argument|arm|army|around|arrive|art|ask|aspect|association|assume|attempt|attention|attitude|authority|available|avoid|award|aware|away|baby|back|bad|bank|base|basic|basis|bear|because|become|bed|before|begin|behavior|behind|believe|benefit|better|between|beyond|big|bill|bit|black|blood|board|body|book|both|box|boy|break|bring|brother|build|building|business|but|buy|call|campaign|can|capital|car|care|carry|case|catch|cause|cell|central|center|century|certain|certainly|chance|change|c |