使用脚本暴力破解 GPG 密码

发布于 2024-10-09 07:51:05 字数 219 浏览 0 评论 0原文

我忘记了 Linux 上 gpg 密钥的密码。有人可以帮我写一个简单的脚本来使用暴力破解密钥吗?我记得密码短语中可能包含的一些单词,所以希望我的计算机不会花很长时间来暴力破解它。

如果我无法恢复密码,一切也不会丢失,这只意味着我在接下来的 10 天内将无法处理我的项目,直到我回去工作以获取文件的另一个副本,但这一次使用我会记住密码的新密钥。

不过,能够在这 10 天里完成我的项目就太好了。

I have forgotten my passphrase for my gpg key on linux. Can someone please help me write a simple script to use bruteforce to crack the key? I remember some of the words which MIGHT be in the passphrase, so hopefully, it will not take long for my computer to bruteforce it.

All is not lost if I can't recover the passphrase, it just means I will not be able to work on my project for the next 10 days until I get back to work to get another copy of the files, but this time with a new key for which I will remember to passphrase.

However, it will be nice to be able to work on my project in these 10 days.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

手长情犹 2024-10-16 07:51:05

也许是这样的:

#!/bin/bash
#

# try all word in words.txt
for word in $(cat words.txt); do 

  # try to decrypt with word
  echo "${word}" | gpg --passphrase-fd 0 --no-tty --decrypt somegpgfile.gpg --output somegpgfile;

  # if decrypt is successfull; stop
  if [ $? -eq 0 ]; then

    echo "GPG passphrase is: ${word}";
    exit 0;

  fi

done;

exit 1;

Maybe something like:

#!/bin/bash
#

# try all word in words.txt
for word in $(cat words.txt); do 

  # try to decrypt with word
  echo "${word}" | gpg --passphrase-fd 0 --no-tty --decrypt somegpgfile.gpg --output somegpgfile;

  # if decrypt is successfull; stop
  if [ $? -eq 0 ]; then

    echo "GPG passphrase is: ${word}";
    exit 0;

  fi

done;

exit 1;
岛徒 2024-10-16 07:51:05

1) 脚本不会简单,至少不会像你想象的那样“简单”。

2) 这需要很长时间 - 这就是使用密码短语而不是简单密码的要点。花时间编写这样的脚本,将您可能会或可能不会出现在短语中的单词加上迭代可能需要十多天的时间。

3)您可能也会忘记下一个密码。

4)哎呀!

抱歉,伙计,是时候开始一个新项目了(至少可以消磨接下来的十天 - 我建议使用密码破解程序作为理想的消遣。)

圣诞快乐!

-奥辛

1) The script won't be simple, at least how you envisage "simple."

2) It will take a long time - that's the point of using pass phrases over simple passwords. Taking the time to write such a script, incorporating your words which may or may not be in the phrase plus a stab at iterating will probably take over ten days.

3) You probably will forget the next passphrase too.

4) Ooops!

Sorry dude, time to start a new project (at least to while away the next ten days - I suggest a passphrase cracker as an ideal distraction.)

Merry Christmas!

-Oisin

浅唱々樱花落 2024-10-16 07:51:05

特斯米滕的答案可能已经过时了。

echo "${word}" | gpg --passphrase-fd 0 -q --batch --allow-multiple-messages --no-tty  --output the_decrypted_file -d /some/input/file.gpg;

我将上面的行与 gpg 2.0.20 和 libcrypt 1.5.2 一起使用来达到预期的结果。

Tersmitten's answer may be out of date.

echo "${word}" | gpg --passphrase-fd 0 -q --batch --allow-multiple-messages --no-tty  --output the_decrypted_file -d /some/input/file.gpg;

I used the above line with gpg 2.0.20 and libcrypt 1.5.2 to achieve the desired results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文