All Projects → D0n9X1n → Hexo Blog Encrypt

D0n9X1n / Hexo Blog Encrypt

Licence: mit
Yet, just another hexo plugin for security.

Projects that are alternatives of or similar to Hexo Blog Encrypt

Hexo Theme Replica
Github style replication for hexo theme
Stars: ✭ 484 (-16.26%)
Mutual labels:  hexo
Stowaway
👻Stowaway -- Multi-hop Proxy Tool for pentesters
Stars: ✭ 500 (-13.49%)
Mutual labels:  encrypt
Hexo Tag Aplayer
Embed aplayer in Hexo posts/pages
Stars: ✭ 552 (-4.5%)
Mutual labels:  hexo
Hexo Theme Suka
🎨Modern, powerful and simple theme for Hexo.
Stars: ✭ 487 (-15.74%)
Mutual labels:  hexo
Hacker
❤️ A simple theme for Hexo
Stars: ✭ 501 (-13.32%)
Mutual labels:  hexo
Hexo Theme One
hexo单页面炫酷主题
Stars: ✭ 522 (-9.69%)
Mutual labels:  hexo
Hexo Theme Yun
☁️ A fast & light & lovely theme for Hexo. 一个对可爱自以为是的 Hexo 主题。
Stars: ✭ 477 (-17.47%)
Mutual labels:  hexo
Site
The website for Hexo.
Stars: ✭ 572 (-1.04%)
Mutual labels:  hexo
Landscape Plus
针对中国大陆地区对hexo官方主题landscape进行优化。
Stars: ✭ 503 (-12.98%)
Mutual labels:  hexo
Hexo Theme Wikitten
A theme of Hexo for personal wiki which seems like Wikitten style.
Stars: ✭ 548 (-5.19%)
Mutual labels:  hexo
Hexo Theme Skapp
The hexo flat design theme(扁平化简约主题)
Stars: ✭ 490 (-15.22%)
Mutual labels:  hexo
Huno
A responsible theme for Hexo
Stars: ✭ 500 (-13.49%)
Mutual labels:  hexo
Hexo Theme Chic
An elegant, powerful, easy-to-read Hexo theme.
Stars: ✭ 539 (-6.75%)
Mutual labels:  hexo
Hexo Theme Keep
🌈 A simple and elegant theme for Hexo. It makes you more focused on writing.
Stars: ✭ 483 (-16.44%)
Mutual labels:  hexo
Hexo Theme Anatole
A white and simple Hexo theme, originated from a Farbox theme
Stars: ✭ 562 (-2.77%)
Mutual labels:  hexo
Hexo Theme Inside
🌈 SPA, Flat and clean theme for Hexo.
Stars: ✭ 480 (-16.96%)
Mutual labels:  hexo
Coyim
coyim - a safe and secure chat client
Stars: ✭ 513 (-11.25%)
Mutual labels:  encrypt
Tkl
Hexo Theme
Stars: ✭ 574 (-0.69%)
Mutual labels:  hexo
Tonyenc
高性能、跨平台的 PHP7 代码加密扩展 (A high performance and cross-platform encrypt extension for PHP source code)
Stars: ✭ 569 (-1.56%)
Mutual labels:  encrypt
Hexo Theme Vexo
🍟 Vexo is a Hexo theme inspired by Vue's official website.
Stars: ✭ 546 (-5.54%)
Mutual labels:  hexo

hexo-blog-encrypt

GitHub release (latest SemVer including pre-releases) Build Status Scrutinizer Code Quality

中文说明

What's this

  • First of all, the BEST post encryption plugin in the universe for hexo.(But what about the other plugins?)

  • It is for those who write a post, but don't want everyone to read it. Thus, password is required in certain pages to access these encrypted posts.

  • Encryption is simple on wordpress, emlog or other blog systems, except hexo. :(

  • So it's "hexo-blog-encrypt"'s time.

Features

  • Once you enter the correct password, you can get the access to encrypted posts, and the password is remembered locally. Press the button again, and the stored password will be erased. If there're scripts in the post, they will be executed once the post is decrypted.

  • Support preset tag-specified password.

  • All functions are provided by the native APIs. We use Crypto in Node.js, and use Web Crypto API in Browsers.

  • PBKDF2, SHA256 is used to derive keys, We use AES256-CBC to encrypt and decrypt data, we also use HMAC to verify message authentication codes to make sure the posts are decrypted well and not modified.

  • Promise is widely used to make sure our main procedures are asynchronous, so that there is little chance for the process to be blocked, and the experience will be more fluent.

  • Template theme supported, you can use [default, blink, flip, shrink, surge, up, wave, xray] to set up your template theme, and CHECK ONLINE.

  • Outdated browsers may not work well. In such case, please upgrade your browser.

Online demo

Install

  • npm install --save hexo-blog-encrypt

  • or yarn add hexo-blog-encrypt (require Yarn)

Quick start

  • Add the "password" value to your post's front matter like:

---
title: Hello World
date: 2016-03-30 21:18:02
password: hello
---

  • Then use hexo clean && hexo g && hexo s to see your encrypted post locally.

Password Priority

post's front matter > encrypt tags

Advanced settings

in post's front matter


---
title: Hello World
tags:
- encryptAsDiary
date: 2016-03-30 21:12:21
password: mikemessi
abstract: Here's something encrypted, password is required to continue reading.
message: Hey, password is required here.
wrong_pass_message: Oh, this is an invalid password. Check and try again, please.
wrong_hash_message: Oh, these decrypted content cannot be verified, but you can still have a look.
---

In _config.yml

Example

# Security
encrypt: # hexo-blog-encrypt
  abstract: Here's something encrypted, password is required to continue reading.
  message: Hey, password is required here.
  tags:
  - {name: encryptAsDiary, password: passwordA}
  - {name: encryptAsTips, password: passwordB}
  wrong_pass_message: Oh, this is an invalid password. Check and try again, please.
  wrong_hash_message: Oh, these decrypted content cannot be verified, but you can still have a look.

To disable tag encryption

Just set the password property in front matter to "".

Example:

---
title: Callback Test
date: 2019-12-21 11:54:07
tags:
    - A Tag should be encrypted
password: ""
---

Use a "" to disable tag encryption.

Config priority

post's front matter > _config.yml (in the root directory) > default

About Callback

In some blogs, some elements may not be displayed normally after decryption. This is a known issue. The current solution is to check the code in your blog to learn which functions are called when the onload event occurs. Then write these code at the end of your post. For example:

---
title: Callback Test
date: 2019-12-21 11:54:07
tags:
    - Encrypted
---

This is a blog to test Callback functions. You just need to add code at the end of your post as follows:

It will be called after the blog is decrypted.

<script>
    // add script tag and code at the end of your post
    alert("Hello World");
</script>

Demo: Callback Example.

Encrypt TOC

If you has a post with TOC, you should change the code of your template. Take the default theme 'landscape' as an example:

  • You should find the article.ejs file located at hexo/themes/landscape/layout/_partial/article.ejs.
  • Find the code like <% post.content %>, which is usually at line 30.
  • Replace the <% post.content %> with the following code block:
<% if(post.toc == true){ %>
  <div id="toc-div" class="toc-article" <% if (post.encrypt == true) { %>style="display:none" <% } %>>
    <strong class="toc-title">Index</strong>
      <% if (post.encrypt == true) { %>
        <%- toc(post.origin, {list_number: true}) %>
      <% } else { %>
        <%- toc(post.content, {list_number: true}) %>
      <% } %>
  </div>
<% } %>
<%- post.content %>

Disable logging

If you want to disable the logging, you can add a silent property in _config.yml and set it to true.

# Security
encrypt: # hexo-blog-encrypt
  silent: true

This would disable the logging like INFO hexo-blog-encrypt: encrypting "{Blog Name}" based on Tag: "EncryptedTag"..

Encrypt Theme

Previously, we use template to let users modify their own themes. Turn out that it's not a simple way. So, we are introducing this feature here.

You can simply use theme in _config.yml or in header like:

In post's front matter

---
title: Theme test
date: 2019-12-21 11:54:07
tags:
    - A Tag should be encrypted
theme: xray
password: "hello"
---

In _config.yml

This would be a default one.

# Security
encrypt: # hexo-blog-encrypt
  abstract: Here's something encrypted, password is required to continue reading.
  message: Hey, password is required here.
  tags:
  - {name: encryptAsDiary, password: passwordA}
  - {name: encryptAsTips, password: passwordB}
  theme: xray
  wrong_pass_message: Oh, this is an invalid password. Check and try again, please.
  wrong_hash_message: Oh, these decrypted content cannot be verified, but you can still have a look.

Check them online, and PICK one:

License

See LICENSE file.

Thanks

Collaborator - xiazeyu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].