Skip to content

Commit cf9ca3a

Browse files
authored
Update README.md
1 parent b471e15 commit cf9ca3a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,19 @@ CookieCloud是一个向自架服务器同步Cookie的小工具,可以将电脑
1616
cd api && yarn install && node app.js
1717
```
1818
默认端口 8088
19+
20+
## Cookie解密算法
21+
22+
1. md5(uuid+password) 取前16位作为key
23+
2. AES.decrypt(encrypted, the_key)
24+
25+
```node
26+
function cookie_decrypt( uuid, encrypted, password )
27+
{
28+
const CryptoJS = require('crypto-js');
29+
const the_key = CryptoJS.MD5(uuid+'-'+password).toString().substring(0,16);
30+
const decrypted = CryptoJS.AES.decrypt(encrypted, the_key).toString(CryptoJS.enc.Utf8);
31+
const parsed = JSON.parse(decrypted);
32+
return parsed;
33+
}
34+
```

0 commit comments

Comments
 (0)