Skip to content

Commit

Permalink
Update pgp_filelock.py
Browse files Browse the repository at this point in the history
  • Loading branch information
x011 authored Feb 7, 2024
1 parent df0767c commit e00d6b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pgp_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def generate_keys(passphrase, private_key_file, public_key_file, overwrite=False
key_expiration=expire_date) # Set the expiration date here

# Generate subkey for encryption
subkey = PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 4096)
subkey = PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, key_size)
primary_key.add_subkey(subkey, usage={KeyFlags.EncryptCommunications, KeyFlags.EncryptStorage})

# Protect the primary key with the passphrase
Expand Down Expand Up @@ -388,13 +388,8 @@ def decrypt_file_cli(args):
generate_parser.add_argument('--name', required=True, help='Name for the UID')
generate_parser.add_argument('--email', required=True, help='Email for the UID')
generate_parser.add_argument('--expire-years', type=int, default=0, help='Number of years until the key expires (optional, default: 0 for no expiration)')

generate_parser.add_argument('--key-size', type=int, choices=[1024, 2048, 4096, 8192], default=4096, help='Key size in bits (default: 4096)')



generate_parser.add_argument('--passphrase', nargs='?', default=None, help='Passphrase for the private key (will prompt if not provided)')

generate_parser.add_argument('--private-key-file', nargs='?', default='private_key.asc', help='Filename for the private key (default: private_key.asc in current directory)')
generate_parser.add_argument('--public-key-file', nargs='?', default='public_key.asc', help='Filename for the public key (default: public_key.asc in current directory)')
generate_parser.add_argument('--overwrite', action='store_true', help='Overwrite existing keys without prompt (default: False)')
Expand Down Expand Up @@ -493,4 +488,4 @@ def decrypt_file_cli(args):
encrypt_button.image = encrypt_image
decrypt_button.image = decrypt_image

root.mainloop()
root.mainloop()

0 comments on commit e00d6b1

Please sign in to comment.