Des and 3DES algorithms implemented in C language under Linux __.net

Source: Internet
Author: User

The Theory of DES algorithm

The DES algorithm belongs to symmetric encryption algorithm, which is widely used in some transactions with higher security requirements, such as payment industry. On the theory of DES algorithm, there are many articles on the Web have detailed explanation, write very well, I do not repeat here, here is a link: http://www.vckbase.com/document/viewdoc/?id=623, please friends to learn their own, My code is written based on the theory here.

II. implementation of the environment and documents

A, Environment: Redhat Linux + C

b, the implementation of the document: Des.h

Des.c

Makefile

Third, the Code

1, des.h documents


Function: To implement DES and 3DES encryption and decryption algorithm
Author: XXX
Date: 2008-9-23

#ifndef Des_h
#define Des_h

static int pc_1_table[56]={57,49,41,33,25,17, 9,
1,58,50,42,34,26,18,
10, 2,59,51,43,35,27,
19,11, 3,60,52,44,36,
63,55,47,39,31,23,15,
7,62,54,46,38,30,22,
14, 6,61,53,45,37,29,
21,13, 5,28,20,12, 4};

static int pc_2_table[48]={14,17,11,24, 1, 5,
3,28,15, 6,21,10,
23,19,12, 4, 26, 8,

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.