Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Openssl symetric and asymetric encrypt-decrypt ja signeerimise howto

Posted on November 3, 2012 - October 19, 2013 by margusja

Asümeetriline:

1. Loo võtmepaar

openssl genrsa -out private.pem 1024

openssl rsa -in private.pem -out public.pem -outform PEM -pubout

2. Jaga oma avaliku võtit partneriga

3. Partner krüpteerib avaliku võtmega

openssl rsautl -encrypt -inkey public.pem -pubin -in file.txt -out file.ssl

4.  Ava salajase võtmega

openssl rsautl -decrypt -inkey private.pem -in file.ssl -out decrypted.txt

Sümeetriline:

Krüpteerimine

openssl aes-256-cbc -salt -a -e -in saladus.txt -out encrypted.txt
enter aes-256-cbc encryption password:
Verifying – enter aes-256-cbc encryption password:

Dešifreerimiseks:

openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
enter aes-256-cbc decryption password:

Signeerimine:

Allkirjastame

openssl rsautl -sign -in saladus.txt -out saladus.signed -inkey private.pem

Partner saab kontrollida

openssl rsautl -verify -in saladus.signed -out saladus.verified -pubin -inkey public.pem

Räsi genereerimiseks on tänaseks MD5 saatanast 128b on ilmselgelt liialt vähe.

> openssl sha1 saladus.txt

või

> shasum -a 256 saladus.txt

Posted in IT, Linux

Post navigation

Inimloom ja “objektloomad”
Kolm untsu läinud lootustandvat IT projekti

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.