Class CmdLinePasswordProvider
- java.lang.Object
-
- ghidra.formats.gfilesystem.crypto.CmdLinePasswordProvider
-
- All Implemented Interfaces:
CryptoProvider,PasswordProvider
public class CmdLinePasswordProvider extends java.lang.Object implements PasswordProvider
APasswordProviderthat supplies passwords to decrypt files via the java jvm invocation.Example:
java -Dfilesystem.passwords=/fullpath/to/textfile
The password file is a plain text tabbed-csv file, where each line specifies a password and an optional file identifier.
Example file contents, where each line is divided into fields by a tab character where the first field is the password and the second optional field is the file's identifying information (name, path, etc):
password1 [tab] myfirstzipfile.zip← supplies a password for the named file located in any directorysomeOtherPassword [tab] /full/path/tozipfile.zip← supplies password for file at specified locationanotherPassword [tab] file:///full/path/tozipfile.zip|zip:///subdir/in/zip/somefile.txt← supplies password for file embedded inside a zipyetAnotherPassword← a password to try for any file that needs a password
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.formats.gfilesystem.crypto.CryptoProvider
CryptoProvider.Session
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCMDLINE_PASSWORD_PROVIDER_PROPERTY_NAME
-
Constructor Summary
Constructors Constructor Description CmdLinePasswordProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Iterator<PasswordValue>getPasswordsFor(FSRL fsrl, java.lang.String prompt, CryptoProvider.Session session)Returns a sequence of passwords (ordered by quality) that may apply to the specified file.
-
-
-
Field Detail
-
CMDLINE_PASSWORD_PROVIDER_PROPERTY_NAME
public static final java.lang.String CMDLINE_PASSWORD_PROVIDER_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPasswordsFor
public java.util.Iterator<PasswordValue> getPasswordsFor(FSRL fsrl, java.lang.String prompt, CryptoProvider.Session session)
Description copied from interface:PasswordProviderReturns a sequence of passwords (ordered by quality) that may apply to the specified file.- Specified by:
getPasswordsForin interfacePasswordProvider- Parameters:
fsrl-FSRLpath to the password protected fileprompt- optional prompt that may be displayed to a usersession- a place to hold state values that persist across related queries- Returns:
Iteratorof possible passwords
-
-