Posts

Showing posts with the label Cryptography

C Program For Caesar Cipher [Encryption & Decryption] | C Programming

Image
Caesar Cipher The Caesar cipher is one of the earliest known and simplest ciphers. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. The method is named after Julius Caesar, who apparently used it to communicate with his generals. More complex encryption schemes such as the Vigenère cipher employ the Caesar cipher as one element of the encryption process. The widely known ROT13 'encryption' is simply a Caesar cipher with an offset of 13. The Caesar cipher offers essentially no communication security, and it will be shown that it can be easily broken even by hand. C Program For Caesar Cipher [Encryption] #include <stdio.h> int main () {     char msg [ 100 ], ch;     int i,key;     printf ( "Enter a plaintext \n " );     gets (msg);     printf ( "Enter key" )

Implementation Of Mono Alphabetic Cipher Encryption-Decryption

Image
Mono Alphabetic Cipher Encryption-Decryption Introduction It is Better than Caesar Cipher. If, instead the “cipher” line can be any permutation of the key 26 alphabetic characters, then there are 26! Or greater than 4 * 10 26  possible keys. This is 10 orders of magnitude greater than the key space for DES and would seem to as a Mono-alphabetic substitution cipher, because a single cipher alphabet is used per message. There is however, another line of attack. If one analytically knows the nature of the plain text, then the analyst can exploit the regularities of the language. Limitations Monoalphabetic ciphers are easy to break because they reflect the frequency data of the original alphabet. A countermeasure is to provide multiple substitutes, known as homophones, for a single letter C Progrm to Encryp the imputed text using Mono Alphabetic Cipher. #include <stdio.h> #include <string.h> int main () {     char pt [ 52 ] = { 'A' , 'B' , 'C' ,