Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Created August 18, 2023 16:50
Show Gist options
  • Save valyakuttan/ec4cd8cfa18c1292883502d6d0d4d34b to your computer and use it in GitHub Desktop.
Save valyakuttan/ec4cd8cfa18c1292883502d6d0d4d34b to your computer and use it in GitHub Desktop.

OpenKeychain

Backup and import gpg key from OpenKeychain

  • Make a bakup from OpenKeychain and transfer it to workstation

  • On the workstation import the key by

    
    $ gpg --decrypt backup_file.pgp | gpg --import
    
    # Enter the Backup Code
    
    $ gpg --edit-key user-id
    
    gpg> trust
    
    # Use 5 for ultimate trust 
    
    

Export gpg key to OpenKeychain

  • Generate a strong random passphrase with gpg

    
    $ gpg --armor ---gen-random 1 20
    
    
  • Encrypt key using passphrase as

    
    $ gpg --armor --export-secret-keys user-id | gpg --armor --symmetric --output mykey.sec.asc
    
    $ # Use the passphrase generated above
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment