_includes/encrypted.html in no-style-please2-0.6.4 vs _includes/encrypted.html in no-style-please2-0.7.0
- old
+ new
@@ -24,16 +24,13 @@
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.1/js/salsa20.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.1/js/base64.js"></script>
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.1/js/md5.js"></script>
<script>
!function(){
-
- {%- capture prefix0 %} {{page.url |default: "no-style-please2" }} {% endcapture -%}
- {%- capture prefix %}{{prefix0 | strip }}{% endcapture -%}
-
- const preFix = "{{prefix}}"
- var encryptedContent = '{{ content | contentEncrypt:page, prefix}}'
+ const preFix = '{{encid}}';
+ const encid = preFix
+ var encryptedContent = '{{ content | encrypt_content:page, encid}}'
const nonceStr = encryptedContent.substring(0,16);
const msg = encryptedContent.substring(17)
function hexToUint8Arr(hexString){
return new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
@@ -130,18 +127,18 @@
}
function clearKey() {
}
{% else %}
function readKey(){
- var key = md5(location.pathname)
+ var key = encid;
return localStorage.getItem(key)
}
function setKey(value){
- var key = md5(location.pathname)
+ var key = encid
return localStorage.setItem(key,value)
}
function clearKey() {
- var key = md5(location.pathname)
+ var key = encid
localStorage.removeItem(key)
}
var cachekey = readKey()
if(cachekey){
decrypt(cachekey,true)
\ No newline at end of file