Openssl之enc、dgst和RSA

作者: 分类: CTF,Security 时间: 2016-11-11 评论: 1条评论

这次最主要探究的rsa相关,encdgst会稍微过一下。

说来这次初探Openssl也是一直想做的一件事,虽然之前已经把《图解密码学》看完了,但是也一直没有去实践一下。这次刚好有这个契机,就直接搞上了。

如果你也是刚刚接触Openssl,那么建议你在看这篇文章的同时,把官方文档打开放在一边,并且打开一个终端,实践出真知。

enc和dgst

enc

稍微过一下这些命令,首先看下官方文档(Openssl 1.0.1)中给出的enc支持的加密方式:

##### SYNOPSIS #####
openssl enc -ciphername [-in filename] [-out filename] [-pass arg] [-e] [-d] [-a/-base64] [-A] [-k password] [-kfile filename] [-K key] [-iv IV] [-S salt] [-salt] [-nosalt] [-z] [-md] [-p] [-P] [-bufsize number] [-nopad] [-debug] [-none] [-engine id]

##### 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.

 gost89             GOST 28147-89 in CFB mode (provided by ccgost engine)
 gost89-cnt        `GOST 28147-89 in CNT mode (provided by ccgost engine) 

 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

阅读全文»

VMware Fusion NAT设置固定IP

作者: 分类: 默认分类 时间: 2016-11-04 评论: 暂无评论

平时用虚拟机都是直接ssh,但是由于是NAT方式,因此IP经常会变,这样时不时就要进虚拟机查一下IP。索性花了点时间把所有的虚拟机IP都设置为固定的IP,这样就方便了许多。

我用的是

VMware Fusion
专业版 8.1.1 (3771013)

因此直接

vim /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf

可以看到如下内容(我只截取所需要的一部分):

subnet 192.168.160.0 netmask 255.255.255.0 {
    range 192.168.160.128 192.168.160.254;
    option broadcast-address 192.168.160.255;
    option domain-name-servers 192.168.160.2;
    option domain-name localdomain;
    default-lease-time 1800;                # default is 30 minutes
    max-lease-time 7200;                    # default is 2 hours
    option netbios-name-servers 192.168.160.2;
    option routers 192.168.160.2;
}

阅读全文»