Last active
December 31, 2021 06:54
-
-
Save emindeniz99/d2958e17a95abc05d80e4f548c2a8e12 to your computer and use it in GitHub Desktop.
Revisions
-
emindeniz99 revised this gist
Dec 31, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ ## idea add a personal info to my personal website but i want it to be accessible with only some key I write this url to my NFC card, so I can easily share my phone number with people https://emindeniz99.com/#1234567890123456 shows my phone number if the hash part is correct -
emindeniz99 renamed this gist
Dec 31, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ <!--!!!RENDERHTML--> <!-- notion.so - nextjs renderer page, my custom html block --> <a id="phone-enc" target="_blank" rel="noopener noreferrer" class="notion-link" href=""></a> -
emindeniz99 created this gist
Dec 31, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ <!--!!!RENDERHTML--> <a id="phone-enc" target="_blank" rel="noopener noreferrer" class="notion-link" href=""></a> <script> (async () => { let pwd = window.location.hash.slice(1) let a = document.getElementById("phone-enc") a.parentElement.style="display:none;" if (!pwd) return; let encccc = new Uint8Array([187, .......1]) let buff = await ((async (text, pw) => { let enc = new TextEncoder(); let keyy = await window.crypto.subtle.importKey( "raw", enc.encode(pw) , "AES-CTR", true, ["encrypt", "decrypt"] ); let a = await window.crypto.subtle.encrypt( { name: "AES-CTR", counter: enc.encode(pw), length: 64 }, keyy, text ); let dec = new TextDecoder(); return dec.decode(a) })(encccc, pwd)); buff; if (buff.includes("tel:")) { let a = document.getElementById("phone-enc") a.parentElement.style = "" a.parentElement.className = "notion-blue_background" a.innerText = buff.slice(4) a.href = buff } })(); </script> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ ## idea add a personal info to my personal website but i want it to be accessible with only some key I write this url to my NFC card, so I can easily share my phone number with people https://emindeniz99.com/#1234567890123456 shows my phone number if the hash part is correct This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,79 @@ let pwd="1234567890123456" // 16 char length let pwd=window.location.hash.slice(1) // it fetch the hash at URL let buff=await ((async (text,pw)=>{ let enc = new TextEncoder(); let keyy=await window.crypto.subtle.importKey( "raw", enc.encode(pw) , "AES-CTR", true, ["encrypt", "decrypt"] ); let a= await window.crypto.subtle.encrypt( { name: "AES-CTR", counter:enc.encode(pw), length: 64 }, keyy, enc.encode(text) ); return a })("tel:+90....your phonenumber",pwd)); buff; new Uint8Array(buff); //decrypt let pwd=window.location.hash.slice(1) let buff=await ((async (text,pw)=>{ let enc = new TextEncoder(); let keyy=await window.crypto.subtle.importKey( "raw", enc.encode(pw) , "AES-CTR", true, ["encrypt", "decrypt"] ); let a= await window.crypto.subtle.encrypt( { name: "AES-CTR", counter:enc.encode(pw), length: 64 }, keyy, text ); let dec = new TextDecoder(); return dec.decode(a) })(new Uint8Array([187, 3, ....... your array from encryption]),pwd)); buff;