Encrypt and decrypt data security 1 OpenSSL installation

Source: Internet
Author: User

Encrypt and decrypt data Security 1 OpenSSL installation





650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/8B/5C/wKioL1hKxQbD5HIyAAAhMSiID1I733.png "title=" Openssl.png "alt=" Wkiol1hkxqbd5hiyaaahmsiid1i733.png "/>

OpenSSL official website:https://www.openssl.org/source/




Unzip, compile, install

Unzip Openssl[email protected]:~ $ cd openssl/[email Protected]:~/openssl $ tar XF openssl-1.1.0[email Protected]:~/openssl $ CD openssl-1.1.0/compilation environment check [email protected]:~/openssl/openssl-1.1.0 $./config [Email protected]:~/openssl/ openssl-1.1.0 $ echo $?0 start compiling [email protected]:~/openssl/openssl-1.1.0 $ make-j 8[email protected]:~/openssl/ openssl-1.1.0 $ echo $?0 start installation, note permissions [email protected]:~/openssl/openssl-1.1.0 $ sudo make install[email protected]:~/ openssl/openssl-1.1.0 $ echo $?0


Test:

[Email Protected]:~/openssl $ cat main.c #include <openssl/sha.h> #include <string.h> #include <stdio.h >int Main (int argc,char** str) {if (argc<2) {printf ("%s \" string\ "\ n", str[0]); return 0;} unsigned char outmd[20];//Note that the number of characters here is 20memset (outmd,0,sizeof (OUTMD)); Sha_ctx STX; Sha1_init (&STX); Sha1_update (&stx,str[1],strlen (str[1)); Sha1_final (OUTMD,&STX); int i;for (i=0;i<20;i++) {printf ("%02x", Outmd[i]);} printf ("\ n"); return 0;} [Email Protected]:~/openssl $ gcc main.c-l crypto-wall &&./a.out "Hello Linux OpenSSL" b15f046fca47459dfbc7b01b 11e4f1a6462847fc[email Protected]:~/openssl $


Verify that the program is correct: http://encode.chahuo.com/

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8B/5C/wKioL1hKxi_jDCXUAABJ5A8E7X4994.png "title=" checksum. png "alt=" Wkiol1hkxi_jdcxuaabj5a8e7x4994.png "/>


This article is from the "Soul Bucket" blog, please be sure to keep this source http://990487026.blog.51cto.com/10133282/1881360

Encrypt and decrypt data security 1 OpenSSL installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.