Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
easychen authored Jan 17, 2023
1 parent b471e15 commit cf9ca3a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ CookieCloud是一个向自架服务器同步Cookie的小工具,可以将电脑
cd api && yarn install && node app.js
```
默认端口 8088

## Cookie解密算法

1. md5(uuid+password) 取前16位作为key
2. AES.decrypt(encrypted, the_key)

```node
function cookie_decrypt( uuid, encrypted, password )
{
const CryptoJS = require('crypto-js');
const the_key = CryptoJS.MD5(uuid+'-'+password).toString().substring(0,16);
const decrypted = CryptoJS.AES.decrypt(encrypted, the_key).toString(CryptoJS.enc.Utf8);
const parsed = JSON.parse(decrypted);
return parsed;
}
```

0 comments on commit cf9ca3a

Please sign in to comment.