← 返回命令列表

Linux command

enc.1s 命令

网络

需要网络或远程资源。

常用示例

Encrypt file

openssl enc -aes-256-cbc -pbkdf2 -in [plaintext] -out [encrypted]

Decrypt file

openssl enc -d -aes-256-cbc -pbkdf2 -in [encrypted] -out [plaintext]

Encrypt with base64

openssl enc -aes-256-cbc -pbkdf2 -a -in [plaintext] -out [encrypted.b64]

Encrypt with explicit password

openssl enc -aes-256-cbc -pbkdf2 -pass pass:[password] -in [file] -out [encrypted]

Print key and IV

openssl enc -aes-256-cbc -pbkdf2 -P -pass pass:[password]

List available ciphers

openssl enc -list

说明

openssl enc performs symmetric encryption and decryption using various cipher algorithms. It is the general-purpose encryption command in OpenSSL. The command supports numerous ciphers including AES, DES, Blowfish, Camellia, ChaCha20, and others. When deriving keys from passwords, use -pbkdf2 for secure key derivation with a salt (enabled by default). Output can be binary or base64-encoded with -a. Common use cases include file encryption, creating encrypted backups, and data protection workflows.

参数

-e
Encrypt the input data (default).
-d
Decrypt the input data.
-in _FILE_
Input file.
-out _FILE_
Output file.
-a, -base64
Base64 encode/decode the data.
-pass _SOURCE_
Password source (e.g., pass:password, file:pathname, env:var, stdin).
-k _PASSWORD_
Password for key derivation. Superseded by -pass.
-pbkdf2
Use PBKDF2 key derivation (recommended; default iteration count 10000).
-iter _COUNT_
Override PBKDF2 iteration count.
-salt
Use a random salt for key derivation (default).
-nosalt
Do not use salt. Not recommended except for testing.
-K _KEY_
Actual encryption key in hex.
-iv _IV_
Actual initialization vector in hex.
-P
Print key and IV then exit; do not encrypt or decrypt.
-p
Print key and IV, then proceed with encryption/decryption.
-list
List all supported ciphers.
-nopad
Disable standard block padding.

FAQ

What is the enc.1s command used for?

openssl enc performs symmetric encryption and decryption using various cipher algorithms. It is the general-purpose encryption command in OpenSSL. The command supports numerous ciphers including AES, DES, Blowfish, Camellia, ChaCha20, and others. When deriving keys from passwords, use -pbkdf2 for secure key derivation with a salt (enabled by default). Output can be binary or base64-encoded with -a. Common use cases include file encryption, creating encrypted backups, and data protection workflows.

How do I run a basic enc.1s example?

Run `openssl enc -aes-256-cbc -pbkdf2 -in [plaintext] -out [encrypted]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -e do in enc.1s?

Encrypt the input data (default).