Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo 加密研究 #123

Closed
2 tasks done
Lruihao opened this issue Oct 7, 2021 · 6 comments
Closed
2 tasks done

hugo 加密研究 #123

Lruihao opened this issue Oct 7, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request tested Processing completion test passed
Milestone

Comments

@Lruihao
Copy link
Member

Lruihao commented Oct 7, 2021

hugo 加密研究,希望提供前端解决方案,不依赖 python 或者 golang

Feature

  • 全文加密 frontmatter 提供 password, message
  • shortcode 提供部分加密

注意事项

  • 文章源码不能公开(GitInfo 将获取失败)
  • 关掉加密文章的 markdown 文档输出

参考

@Lruihao Lruihao added the enhancement New feature or request label Oct 7, 2021
@Lruihao Lruihao transferred this issue from Lruihao/hugo-blog Apr 22, 2022
@labulac
Copy link

labulac commented Apr 24, 2022

有相同的加密需求,可以参考hexo插件

感谢作者辛苦付出

@Lruihao
Copy link
Member Author

Lruihao commented Apr 24, 2022

有相同的加密需求,可以参考hexo插件

感谢作者辛苦付出

嗯嗯,尽可能在v0.2.14发布,最晚下个版本

@Lruihao
Copy link
Member Author

Lruihao commented May 25, 2022

🚧 Developed

加密 go-html-template

  • 模板加密渲染

解密 JavaScript

  • 内容解密还原
    • 英文内容
    • 中文内容
    • emoji
  • 隐藏或禁用一些组件和功能
    • 目录
    • 编辑此页等按钮
    • 在搜索结果中隐藏
    • 强制阻止 markdown 输出 (i18n) T "encryptedAbstract"
  • 记住解密状态
  • 清除解密状态
  • input UI (i18n) T "password" T "encryptedMessage"

fixit-decryptor.js 插件

Class FixItDecryptor()

  • Options / Lifecycle Hooks
    • decrypted handler after decrypting
    • reset handler after encrypting again
    • duration number of seconds to cache decryption statistics. unit: s
  • Events
    • decrypted
    • reset
  • Methods
    • init
    • validateCache
    • addEventListener(event, listener)
    • removeEventListener(event, listener)

@Lruihao Lruihao added the testing Processing completed to be tested label May 26, 2022
Lruihao added a commit that referenced this issue May 26, 2022
 * @param {Number} [options.duration] seconds of caching decrypted stat. unit: s
Lruihao added a commit that referenced this issue May 26, 2022
 * @param {Number} [options.duration] number of seconds to cache decryption statistics. unit: s
Lruihao added a commit that referenced this issue May 26, 2022
Lruihao added a commit that referenced this issue May 27, 2022
@Lruihao
Copy link
Member Author

Lruihao commented May 30, 2022

全文加密功能已完成

@Lruihao
Copy link
Member Author

Lruihao commented Jul 2, 2022

部分加密 fixit-encryptor shortcode 已完成。

@Lruihao
Copy link
Member Author

Lruihao commented Sep 4, 2024

由于 Hugo 已提供的 hashcrypto 函数中截至 Hugo v0.132.0 为止并没有类似 AES 的对称加密,所以,这个方案缺点很明显,加密部分确实很弱,请大家谨慎考虑使用该功能。


2024-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tested Processing completion test passed
Projects
Archived in project
Development

No branches or pull requests

2 participants