Use ascii to encrypt strings and ascii to encrypt strings

Source: Internet
Author: User

Use ascii to encrypt strings and ascii to encrypt strings

Algorithm: replace the original letter with the fourth letter after the original letter.
Plaintext: China ciphertext: Glmre

# Include <stdio. h> int main () {char c1, c2, c3, c4, c5; c1 = 'C'; c2 = 'H'; c3 = 'I '; c4 = 'n'; c5 = 'a'; c1 + = 4; // convert the character of c1 to ascii code plus 4 and then assign c1 c2 + = 4; // convert the c2 character into an ascii code plus 4 and then assign it to c2 itself c3 + = 4; // convert the c3 character into an ascii code plus 4 and then assign the c3 c4 + = 4; // convert c4 characters into ascii codes plus 4 and then assign c4 c5 + = 4; // convert c5 characters into ascii codes plus 4 and then assign them to c5 putchar (c1); putchar (c2); putchar (c3); putchar (c4 ); putchar (c5); printf ("\ n % c \ n", c1, c2, c3, c4, c5); return 0 ;}

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.