当我尝试使用pikepdf打开一个受密码保护的pdf文件时,它会运行给我这个错误:运行时错误:无法加载openssl遗留提供程序
def crack(self, pdf_file="", numbers_only="n", possible_length=10, **kwargs):
file_exist = path.exists(pdf_file)
cracking = True
if file_exist:
if numbers_only == "y" or numbers_only == "Y":
while cracking:
password = [choice(NUMBERS) for _ in range(possible_length)]
password = "".join(password)
print(f"[SYSTEM] Cracking {pdf_file}: {password}", end="\r")
try:
Pdf.open(pdf_file, password=password)
print("PASSWORD FOUND: " + password)
cracking = False
except:
continue
else:
print(f"[ERROR] File does not exists ${pdf_file}")
sys.exit()
我以为它会尝试打开文件。
1条答案
按热度按时间50few1ms1#
如果你在macOS上,你必须在你的机器上安装OpenSSL
对于Windows,您可以在其官方网站上找到安装程序-https://slproweb.com/products/Win32OpenSSL.html
对于基于Linux的操作系统,使用