LiteLoaderQQNT-PGP-Encryption
LiteLoaderQQNT-PGP-Encryption copied to clipboard
在 QQ 中使用 PGP 进行端到端加密,支持半自动加密和自动解密。
现在手动导入还是有诸多不便,希望能在私聊时直接右键密钥文件消息,来直接导入并绑定对方。
由于 gpg4win 对中文路径支持非常糟糕(完全无法启动),我不得不使用来自 winget 的 gpg 命令行,但此插件无法识别到我的密钥  ``` gpg --version gpg (GnuPG) 2.4.6 libgcrypt 1.11.0 Copyright (C) 2024 g10 Code GmbH License GNU GPL-3.0-or-later This is free software: you...
目前是使用这种简单的检测方法: https://github.com/TransparentLC/LiteLoaderQQNT-PGP-Encryption/blob/938b4d8b9bfef3b224a569e912669949de0bbe3a/src/renderer/index.ts#L41-L44 之前也在 https://github.com/TransparentLC/LiteLoaderQQNT-PGP-Encryption/issues/1#issuecomment-2531409584 考虑过使用一个更详细的正则表达式检测整个消息,但是发现可能会 ReDoS,所以也没有实装。 ```js // 每一行后面有一个空格 `-----BEGIN PGP MESSAGE----- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx =xxxx -----END PGP MESSAGE----- `.match(/^-----BEGIN PGP MESSAGE-----\s*(?:.+?:.*\n)*\s*\n(?:[A-Za-z\d+\/]*\n?)*={0,2}\n=(?:[A-Za-z\d+\/]{4})?\n\s*-----END PGP MESSAGE-----\s*$/); ```