Using GPG to encrypt and decrypt a file

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • in this quick video you can see how to use GPG commands to encrypt and decypt a file.
    - demo using GnuPG/GPG CLI
    - GPG to encrypt and decrypt a (data) file
    - Key lifecycle - Export and import keys (public and private keys)
    ------------------------------------------------------------------------
    Install:
    --------
    apt-get install gnupg
    List keys:
    ----------
    gpg --list-secret-keys
    gpg --list-keys
    Generate keys:
    -------------
    gpg --full-generate-key
    OR
    gpg --gen-key
    Export/Import keys:
    -------------------
    gpg --export -a Melvin > melvin_public.key
    gpg --import melvin_public.key
    gpg --export-secret-keys Melvin > melvin-private-key.key
    gpg --import melvin-private-key.key
    Encrypt & Decrypt
    -----------------
    gpg -e -r "Melvin" users.csv
    gpg --always-trust -e -r "Melvin" users.csv
    gpg -d users.csv.gpg
    gpg --batch --passphrase demo users.csv.gpg

Komentáře • 52

  • @philchapman7980
    @philchapman7980 Před 4 lety +6

    Thanks for the tutorial of GPG. By far it’s the best I have been able to find on the internet.

  • @googlewalle8904
    @googlewalle8904 Před 2 lety

    I work with Encryption Appliance solutions but never had the need to understand Exporting/Importing keys (due to separation of duties these days) and it really just helped me understand another important component where you can separate out the Private and Public keys and Encrypt files at another source. Excellent video Melvin and great job explaining it.

  • @machinarum
    @machinarum Před 2 měsíci

    Great video! It goes straight to my library. I will share the link if someone asks me about the subject.

  • @motivationadda163
    @motivationadda163 Před 4 lety +3

    OMG man you nailed it, i wasted days but this 18 min video saves me

  • @ehabbustami7691
    @ehabbustami7691 Před 4 lety +1

    Thanks for clear and organized explanation for the GnuPG CLI.

  • @borjonx
    @borjonx Před 4 lety +1

    Thank you from 1.5 years later! Exactly what I needed. Clear, concise & to the point. Thank you also for having your commands pre-typed; that saves time & we can pause as necessary.

    • @melvinl5797
      @melvinl5797  Před 4 lety +1

      Welcome 😀

    • @Mohitparmar1830
      @Mohitparmar1830 Před 4 lety

      i need gpg encrypted so any have contacts me teligram @decoded4444

    • @genkiferal7178
      @genkiferal7178 Před 2 lety +1

      what he said. thanks for typing it all out so we can practice along with the video...pause video, then cut and paste into our own terminal.
      i would like the comment and video, but since Google doesn't trust me/us with the power to dislike, i figure i cannot be trusted to like, either. i might mess it up somehow.

  • @FranciscoLegonDev
    @FranciscoLegonDev Před rokem

    Thank you for such a clear step-by-step explanation. This is great content

  • @saarang4637
    @saarang4637 Před 2 lety +1

    Fantastic video, to the point information.
    Thank you for helping me understand how to use gpg :)

  • @michaelbenett410
    @michaelbenett410 Před 2 měsíci

    Certified GOAT. thx a lot

  • @SelectFrom
    @SelectFrom Před 3 lety +2

    Thank you a lot for the clear explanation!

  • @egorshumanskii8026
    @egorshumanskii8026 Před 5 lety +3

    Finally I get it. Thanks so much! Good job!

  • @majorblazer9055
    @majorblazer9055 Před 3 lety +1

    thanks so much and thanks for providing the examples, copy pasted to my cheat sheet :)

  • @fs8820
    @fs8820 Před 3 lety

    Liked, subscribed, bookmarked. That was the BEST, clearest demo. Thank you!

  • @Uneke
    @Uneke Před 2 lety +1

    Ubuntu is a Debian based OS, Debian is a kernel, Ubuntu is not a kernel… just thought I’d correct your remark at 1:40
    Other than that, very informative! I’ve been following the Man page of gpg… but I keep running into issues with card keys and a couple other options lol so I gave your bid a try, to get a better scope of things.
    Thanks!

    • @odigity
      @odigity Před rokem

      Debian is not a kernel, it's a distribution - kernel + init process + libraries + executables.
      The Linux kernel is the kernel.
      The term "Linux" technically refers to the kernel, but is colloquially used for all distributions based on the Linux kernel, such as Debian and Ubuntu.

  • @chrischiu2335
    @chrischiu2335 Před 4 lety +1

    Thanks Melvin. It is a great tutorial for the gpg tutorial.

  • @hasanerhanaydinoglu3617
    @hasanerhanaydinoglu3617 Před 2 lety +1

    very accurate and useful infromation. thanks

  • @douniazedbehloul5766
    @douniazedbehloul5766 Před 3 lety +1

    pretty cool ! and well explained thank you

  • @pharandess
    @pharandess Před 4 dny

    Very useful thanks lot

  • @gawronwwa
    @gawronwwa Před 4 lety +5

    you have a problem with mic volume, we can barely hear you. Nice tutorial though :)

  • @cjbaezilla
    @cjbaezilla Před 4 lety +1

    Thank you very much Melvin

  • @nagarocky
    @nagarocky Před 5 lety

    Great explanation. Simply superb. Thanks.

  • @8080VB
    @8080VB Před 3 lety

    Thankyou so much Melvin 🎈⚡

  • @rameshbhilai
    @rameshbhilai Před 2 lety

    Sir earlier in windows 7 system i encrypted the folder subsequently i formatting the system with windows 10 now when I opening the file it show access denied plz help me

  • @BernoTheSage
    @BernoTheSage Před 3 lety

    Thanks for this video, it's very helpful.

  • @gnuPirate
    @gnuPirate Před 2 lety

    Great demo, thanks!

  • @OthmanAlikhan
    @OthmanAlikhan Před 2 lety

    Thanks for the video, very useful =)

  • @MrMoscs
    @MrMoscs Před 5 měsíci

    Thank you

  • @KhrThy
    @KhrThy Před rokem

    Can we set remember passphrase after restarting the machine?

  • @RoHanTecH03
    @RoHanTecH03 Před 4 lety +1

    Sir. Also my all file in pc are encrypted by. NLAH. extention please help me plz tell me what to do. Plz sir 😭😭😭😭😭😭🙏🙏🙏

  • @saraalobaidli
    @saraalobaidli Před 8 měsíci

    How you opened both screens in both sides?

  • @Arek_Frac
    @Arek_Frac Před 5 lety

    good job Melvin!

  • @aaronmoon7084
    @aaronmoon7084 Před 4 lety

    For encrypt terminal, do I have to open another kali linux vm ? Or can I simply open another terminal on same vm for encryption? I assume the original terminal for decryption...

  • @mrinalinivverma
    @mrinalinivverma Před 2 lety

    Hi,
    Thanks for the video .
    While decryption of the file in Linux, I am getting the following erro. using this command error: gpg -o filename -d filename.gpg You need a passphrase to unlock the secret key for user:"username(remarks)" 2048 bit rsa key , id , created date (main id)
    gpg:canncelled by user gpg encrypted with RSA key ID , DATE, "username(remarks)" gpg: public key decryption failed :Operation cancelled gpg: decryption failed: No secret key.
    not able to enter passphrase as it is directly adding the error

  • @user-hh3uu1ob8d
    @user-hh3uu1ob8d Před 5 lety

    Thanks! You a really help!

  • @leandroocampos6262
    @leandroocampos6262 Před 4 lety

    How do you encrypt more than one file at a time?
    In my script I have the following line:
    --trust-model always --encrypt --recipient myPublickey "path file"
    But I can only encrypt one file at a time, I can't do it per batch.

    • @melvinl5797
      @melvinl5797  Před 4 lety +1

      Create a tar with the required files. Then you only have to encrypt the tar file

  • @workpfeiffer3428
    @workpfeiffer3428 Před 4 lety

    well done

  • @alireza2974
    @alireza2974 Před 3 lety

    Thanks

  • @R_Ultraloud
    @R_Ultraloud Před 5 lety

    Thanks!

  • @philchapman7980
    @philchapman7980 Před 4 lety +1

    Please explain the batch so you won't need to enter the passcode

    • @philchapman7980
      @philchapman7980 Před 4 lety +1

      I finally realized that batch, is a GPG command and not a batch file.

  • @ibaadofnaqvi
    @ibaadofnaqvi Před 4 lety

    How do I decrypt a ransom ware encrypted file

    • @AnthonyDentinger
      @AnthonyDentinger Před 3 lety

      Normally you can’t ; that’s the point : they encrypt your data and ask you money or something else to give you the private key to decrypt it.

  • @m0rphe0-8
    @m0rphe0-8 Před 3 lety

    not work, "gpg: agent_genkey failed: Permiso denegado"

    • @AnthonyDentinger
      @AnthonyDentinger Před 3 lety +1

      You probably ran the command in a directory that you cannot write to, or you are not allowed to read the file you were running this command for, or you were trying to overwrite a file you weren’t allowed to write to. Use "ls -l" to tell what the permissions of the file and the directory are.

  • @georgeunknown2833
    @georgeunknown2833 Před 4 lety

    I don't use real name. Instead of it I name myself something like "RaC9veof6ahKaeshie" (generated by pwgen).

  • @paullambert1981
    @paullambert1981 Před 3 lety

    He loses me from the beginning. He doesn't tell me how he got into whatever program he is in. I have no idea how he got into that. Because of that, I am out.

    • @melvinl5797
      @melvinl5797  Před 3 lety +3

      Let me see if I understand your comment . You don’t understand that I opened a terminal ? You have never used /seen a terminal and you were expecting I only click on buttons in a video. Perhaps I should start my video with “first switch on the computer” to cater to absolute beginners