Skip to content

yiyungent/hexo-anti-spider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-encrypt-token

🍰 自用 Hexo 简单反爬虫方案, 同时给与友好SEO, 修改自 D0n9X1n/hexo-blog-encrypt

repo size LICENSE NPM version NPM downloads QQ Group

Intro

自用 Hexo 简单反爬虫方案, 同时给与友好SEO, 修改自 D0n9X1n/hexo-blog-encrypt

采用加密文章内容并自动解密的方式简单反爬虫, 同时提供SEO友好内容

Usage

npm install hexo-encrypt-token --save
<head>
  <!-- hexo-encrypt-token -->
  <script>
    // hexo-encrypt-token
    var storage = window.localStorage;
    var storageName = 'hexo-encrypt-token'; 
    // 下方自行调节: tokenJsonStr
    var tokenJsonStr = `{
      "dk": {
        "alg": "A256CBC",
        "ext": true,
        "k": "5YxPbPj0WL0xWESGtmtvC42cHRrluRMA8Lgo85Xzv10",
        "key_ops": [ "decrypt" ],
        "kty": "oct"
      },
      "iv": "802b4349e5eb3aad98158dde9b831b85",
      "hmk": {
        "alg": "HS256",
        "ext": true,
        "k": "5YxPbPj0WL0xWESGtmtvC42cHRrluRMA8Lgo85Xzv10",
        "key_ops": [ "verify" ],
        "kty": "oct"
      }
    }`;
    storage.setItem(storageName, tokenJsonStr);
  </script>
  <!-- End hexo-encrypt-token -->
</head>
$token="admin"
# 此脚本可批量设置 ./source/_posts 目录下的所有 md 文章的 password 
# $token="admin" 即为设置 password 为 admin
./password.ps1

使用案例

Related Projects

Donate

hexo-encrypt-token is an MIT licensed open source project and completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.

We accept donations through these channels:

Author

hexo-encrypt-token © yiyun, Released under the MIT License.
Authored and maintained by yiyun with help from contributors (list).

GitHub @yiyungent Gitee @yiyungent