I am currently using Java to create a program that parses the passwords of PDF files in bulk.
I have a code that prints the half-width alphanumeric combination for n characters, but I don't know how to automatically enter the password for the file.
import java.util.Scanner;
class Analysis {
static void recursive_increment(int digit, String[] an, String [ ] str) {
if(digit==0){
for(inti=0;i<ans.length;i++){
System.out.print(ans[i]);
}
System.out.print("\n");
} else {
for(inti=0;i<62;i++){
an [digit-1] = str[i];
recursive_increment(digit-1,ans,str);
}
}
}
public static void main(String args[]){
Scanner scn = new Scanner (System.in);
System.out.println("How many digits do you want to analyze?");
int num=scn.nextInt();
String str[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
"L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"1","2","3","4","5","6","7","8","9","0"};
Stringans[] = new String [num];
int digit = num;
recursive_increment(digit,ans,str);
}
}
I don't know how to automatically enter a password.
Create a PDF called iText
and set a password to the PDF using the conversion library.
It seems that you can convert a PDF with a password to a PDF without a password.
https://kb.itextpdf.com/home/it7kb/faq/how-to-decrypt-a-pdf-document-with-the-owner-password
© 2024 OneMinuteCode. All rights reserved.