Linux Security Cookbook (2024)

Table of Contents
Problem Solution Discussion

Solution

$ gpg -c filename

Discussion

Symmetricencryption (-c)is the simplest way to encrypt a file with gpg:just provide a password at encryption time. To decrypt, provide thepassword again.

By default, encrypted files are binary. To produce an ASCII text fileinstead, add the -a (armor) option:

$ gpg -c -a filename

Binary encrypted files are created with the suffix.gpg , whereas ASCII encrypted fileshave the suffix .asc.

Though simple, symmetric encryption has some gotchas:

  • It’s not practical for handling multiple files atonce, as in scripts:

     A bad idea:#!/bin/shfor file in file1 file2 file3 ...do gpg -c "$file"done

    GnuPG will prompt for the password for each fileduring encryption and decryption. This is tedious and error-prone.Public-key encryption does not have this limitation, since nopassphrase is needed to encrypt a file. [Recipe 7.6]Another strategy is to bundle the files into a single file usingtar , then encrypt thetarball. [Recipe 7.18]

  • If you mistype the password during encryption anddon’t realize it, kiss your data goodbye. Youcan’t decrypt the file without the mistyped (andtherefore unknown) password. gpg prompts you forthe password twice, so there’s less chanceyou’ll mistype it, but GnuPG’s public-keyencryption leaves less opportunity to mistype a password unknowingly.

  • It’s not much good for sharing files securely, since you’d also ...

Get Linux Security Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Linux Security Cookbook (2024)
Top Articles
IRCTC Cancellation Charge and Refund Rules + Refund Calculator
Naira rebounds to 1,275/$ at parallel market
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 5818

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.