Promemoria su come si
codificano e decodificano oppure come si criptano e decrittano i file
usando il comando openssl
# Nel seguito appaiono in corsivo l'output dei
comandi e il prompt della shell.
# Per ottenere una semplice hash (valore di controllo) di un file, si
può fare così:
[utente@macchina ]$ openssl dgst
-ripemd160 file.txt
RIPEMD160(file.txt)=
2ef1442a442af43441c81108670dca3e451dbe90
# Per codificare un file con
base64 senza password, si può fare così:
[utente@macchina ]$ openssl enc
-base64 -in file.txt -out file.enc
# Per decodificare il file
criptato nel passo precedente, verso lo standard
# output, si deve fare:
[utente@macchina ]$ openssl enc
-base64 -d -in file.enc
# Per criptare un file con il
metodo "cast" e password, si può fare così:
[utente@macchina ]$ openssl enc
-cast -salt -in file.txt -out file.enc
enter cast5-cbc
encryption password:
Verifying -
enter cast5-cbc encryption password:
# Per decrittare il file criptato
nel passo precedente, verso lo standard
# output, si deve fare:
[utente@macchina ]$ openssl enc
-cast -d -in file.enc
enter cast5-cbc
decryption password:
# Alcune informazioni accessorie:
# lista degli algoritmi
utilizzabili per il calcolo delle hash (tratta dalla pagina man del
comando ssl-dgst):
-md5
-md4
-md2
-sha1
-sha
-mdc2
-ripemd160
# Lista degli algoritmi
utilizzabili per la codifica o il criptaggio dei file (tratta dalla
pagina man del comando ssl-enc):
SUPPORTED
CIPHERS
base64
Base
64
bf-cbc
Blowfish
in CBC mode
bf
Alias
for bf-cbc
bf-cfb
Blowfish
in CFB mode
bf-ecb
Blowfish
in ECB mode
bf-ofb
Blowfish
in OFB mode
cast-cbc
CAST in CBC mode
cast
Alias
for cast-cbc
cast5-cbc CAST5
in CBC mode
cast5-cfb CAST5
in CFB mode
cast5-ecb CAST5
in ECB mode
cast5-ofb CAST5
in OFB mode
des-cbc
DES
in CBC mode
des
Alias
for des-cbc
des-cfb
DES
in CBC mode
des-ofb
DES
in OFB mode
des-ecb
DES
in ECB mode
des-ede-cbc Two key triple
DES EDE in CBC mode
des-ede
Two
key triple DES EDE in ECB mode
des-ede-cfb Two key triple
DES EDE in CFB mode
des-ede-ofb Two key triple
DES EDE in OFB mode
des-ede3-cbc Three key triple DES
EDE in CBC mode
des-ede3
Three key triple DES EDE in ECB mode
des3
Alias
for des-ede3-cbc
des-ede3-cfb Three key triple DES
EDE CFB mode
des-ede3-ofb Three key triple DES
EDE in OFB mode
desx
DESX
algorithm.
idea-cbc
IDEA algorithm in CBC mode
idea
same
as idea-cbc
idea-cfb
IDEA in CFB mode
idea-ecb
IDEA in ECB mode
idea-ofb
IDEA in OFB mode
rc2-cbc
128
bit RC2 in CBC mode
rc2
Alias
for rc2-cbc
rc2-cfb
128
bit RC2 in CFB mode
rc2-ecb
128
bit RC2 in ECB mode
rc2-ofb
128
bit RC2 in OFB mode
rc2-64-cbc 64 bit RC2
in CBC mode
rc2-40-cbc 40 bit RC2
in CBC mode
rc4
128
bit RC4
rc4-64
64
bit RC4
rc4-40
40
bit RC4
rc5-cbc
RC5
cipher in CBC mode
rc5
Alias
for rc5-cbc
rc5-cfb
RC5
cipher in CFB mode
rc5-ecb
RC5
cipher in ECB mode
rc5-ofb
RC5
cipher in OFB mode
aes-[128⎪192⎪256]-cbc 128/192/256 bit
AES in CBC mode
aes-[128⎪192⎪256] Alias for
aes-[128⎪192⎪256]-cbc
aes-[128⎪192⎪256]-cfb
128/192/256 bit AES in 128 bit CFB mode
aes-[128⎪192⎪256]-cfb1
128/192/256 bit AES in 1 bit CFB mode
aes-[128⎪192⎪256]-cfb8
128/192/256 bit AES in 8 bit CFB mode
aes-[128⎪192⎪256]-ecb
128/192/256 bit AES in ECB mode
aes-[128⎪192⎪256]-ofb
128/192/256 bit AES in OFB mode
# Versione di openssl usata:
[utente@macchina ]$ openssl version
OpenSSL 0.9.8o
01 Jun 2010
# Sistema operativo usato:
[utente@macchina ]$ uname -sr
Linux
2.6.34-gentoo-r1
[utente@macchina ]$ cat /etc/gentoo-release
Gentoo Base System release 1.12.13
Ultimo aggiornamento: 28 luglio 2010
< Torna alla pagina
superiore <
<<
Torna
alla pagina iniziale <<