2月 9th, 2008

opensslの便利なコマンド

Posted in Linux, Solaris by tatenaga

□暗号化
 ”enc”でコマンドラインからお手軽に暗号化出来ます。

# 例)文字列「test」を「key」を鍵にして暗号化方? Blowfish、暗号化モードECBで暗号化し、さらぜ Base64でテキスト化ぜ md2でボ ッシュ化
$ echo "test" | /usr/bin/openssl enc -bf-ecb -base64 -k 'key' | /usr/bin/openssl dgst -md2
09470f10bffdc48af84c9b3c3a5652fb

? HTTPS通?
 通常、HTTPポートやSNMPポートにアクセスする時ぜ telnetを使用します。しかし、telnetでは平文しか扱えない為、HTTPSプロトコルは扱えません。”s_client”を使用すれぜ HTTPSアクセスが可能です。使い方ぜ telnetと全ぜ 同じ。

$ /usr/bin/openssl s_client -host 192.168.0.1 -port 443
CONNECTED(00000003)
depth=0 /C=JP/ST=Tokyo/L=Chuo-ku
verify error:num=18:self signed certificate
verify return:1
depth=0 /C=JP/ST=Tokyo/L=Chuo-ku
verify return:1
---
Certificate chain
 0	s:/C=JP/ST=Tokyo/L=Chuo-ku
	i:/C=JP/ST=Tokyo/L=Chuo-ku
---
Server certificate
-----BEGIN CERTIFICATE-----
MIICeDCCAeGgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UEBhMCSlAx
DjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdDaHVsdvvsdRkwFwYDVQQKExBSRUNS
VUlUIENPLixMVEQuMRAwDgYDVQQLFAdSRUNfQUJSMSMwIQYDVQQDExp3d3cuYWIt
cm9hZC5uZXQuYWJyfewrgeRlbDAeFw0wOTA5MTUwNzQzNDVaFw0xOTA5MTMwNzQz
NDVaMIGBMQswCQYDVQQGEwJKUDEOMAwGA1UECBMFVG9reW8xEDAOBgNVBAcTB0No
dW8ta3UxGTAXBgNVBAoTEFJFQ1JVSVQgQ08uLExURC4xEDAOBgNVBAsUB1JFQ19B
QlIxIzAhBgNVBAMTGnd3dy5hYi1yb2FkLm5ldC5hYnIucmFmdGVsMIGfMA0GCSqG
SIb3DQEBAQUAA4GNADCBiQKBgQCsdvsdF/Gd3eqRCgy/9Vt+hYauFfqLmh1UGQGO
UIMBQtITIhCSkqgCzhlYy4WgNR1irMWq1KfB9GyMk2KUEJaIK3d1FnyG5CPtsopc
dFpMLKDcVmqPasdvhzHKtjlaM0AnJLwWMjTUIohGrveLKP3Amc0fHi6K/8BHnad3
9EnTTQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAKYUfeMes/AGNu/vYVonEezttSyd
X89hSOh0iNCb4Ov0XYKYdQiWHEcCeZn9PW3NXYdBKpzmeevMAsQkhNjJHFx65zva
ocT0p5r3XtVi0Q7HNik4gix6EHfXo4RZnV1zkPoobja0386Q1vF4VAB40e+ZopP5
XXuUYRCUnZKUNoHD
-----END CERTIFICATE-----
subject=/C=JP/ST=Tokyo/L=Chuo-ku
issuer=/C=JP/ST=Tokyo/L=Chuo-ku
---
No client certificate CA names sent
---
SSL handshake has read 782 bytes and written 315 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-MD5
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
	Protocol  : TLSv1
	Cipher    : RC4-MD5
	Session-ID: 7E634A41CA78FF65BB31A7A8FD596F7dddDED0CB537BBBC0C32ED29B90C0F54C
	Session-ID-ctx:
	Master-Key: B2B4102E44C136790B1dddFB5226EE700FF441FF9527C03488E973B10AFC4EC38B604396A8F13F7AEBA8A0ECEF2ABD49
	Key-Arg   : None
	Krb5 Principal: None
	Start Time: 1255429426
	Timeout   : 300 (sec)
	Verify return code: 18 (self signed certificate)
---
GET / HTTP/1.0

HTTP/1.1 200 OK
Date: Tue, 13 Oct 2009 10:23:53 GMT
Server: Apache
Accept-Ranges: bytes
Connection: close
Content-Type: text/html

TEST

Tuesday, 13-Oct-2009 19:23:53 JST
read:errno=0
You can leave a comment, or trackback from your own site. RSS 2.0

14 comments

  1. paket wisata ke pulau tidung says:

    I do not even know the way I stopped up right here,
    but I thought this publish was great. I do not recognise who you are but definitely you are going to a famous blogger should you aren’t already.
    Cheers!

    8月 17th, 2015 at 1:58:58

  2. iron stair railing says:

    Hi there, You have done an incredible job. I will definitely digg it and personally recommend to my friends.
    I’m confident they’ll be benefited from this web site.

    8月 17th, 2015 at 11:25:45

  3. เสื้อผ้าแฟชั่น says:

    It’s amazing designed for me to have a web page, which is
    useful in support of my know-how. thanks admin

    9月 30th, 2015 at 12:04:31

  4. investments with high return says:

    Once you buy a home, there are multiple ways
    of making money out of it. Once this is done then you may also include Google Ad sense advertisements on your website to earn an extra edge.
    And as the adage goes, if it sounds too good to be true, it probably is.

    11月 4th, 2015 at 12:05:23

  5. coupons for nhl shop says:

    coupons for nhl shop nba shop coupon code nhl shop free shipping code

    3月 21st, 2016 at 15:39:42

  6. detroit lions jerseys wcf says:

    Get detroit lions jerseys wcf, More Cheap Hot Jerseys Contact Us Online.

    8月 2nd, 2016 at 8:38:19

  7. pokerace99 says:

    You never have too waіt in line to play, oor wait for
    a dealer too sіt down to begin playing. If thе pirs don’t have weak cards, place both pɑirs in first set and high
    cards in second set. There aree mwny websites dedіcated to helping Australians
    choⲟse thе best poker sites.

    my webb blog pokerace99

    8月 15th, 2016 at 21:43:22

  8. finnish translation services says:

    We have unique systems to pick just the correct person for the job promptly and quickly so you have
    a translation that speaks straight to your audience.

    My web page finnish translation services

    8月 24th, 2016 at 23:36:21

  9. www.fundacionblasmendezponce.org says:

    Este procedimiento ha sido empleado por los cerrajeros para abrir las puertas mas ahora es el método preferido de los ladrones.

    10月 8th, 2016 at 21:12:28

  10. stock trainer virtual trading says:

    It is not my first time to pay a quick visit this website,
    i am visiting this site dailly and take pleasant facts from here daily.

    1月 8th, 2017 at 17:27:20

  11. 45 Rod Smith Jersey says:

    45 Rod Smith Jersey.Visit the official Jerseys store of the
    NFL,NHL,NBA,MLB,soccer,NCAA, supply China Jerseys from China.

    Discount all kinds of 47 Quinton Dunbar Jersey,
    free shipping.

    8月 1st, 2017 at 11:11:05

  12. dạ dày says:

    I am in fact thankful to the holder of this web site who has shared
    this fantastic paragraph at at this place.

    5月 17th, 2018 at 19:59:19

  13. Leigh says:

    Can I simply say what a relief to discover someone that genuinely knows what they are discussing on the net.
    You certainly know how to bring a problem to light and make it important.
    More and more people should check this out and understand this side of your story.
    I was surprised you are not more popular because you surely have the gift.

    6月 9th, 2018 at 5:19:19

  14. holyfieldart.com says:

    Life, like gambling, is a constant battle with the unknown.
    Most strong and established sites also offer free trials of their casino or poker software.
    With her dark features and alluring looks can make any man turn around.

    10月 23rd, 2018 at 21:11:24

Leave a comment