4
// // vignere cypher encryption.c // EX 17 // // Created by Cyrus Shadman Safdar on 4/8/15. // Copyright (c) 2015 Cyrus Shadman Safdar. All rights reserved. // #include <stdio.h> #include <string.h> main() { int len,i,x,jlen,add[256],num,n; //Declaring Length of String x=3; char string[1024],j[256]; // Declaring the Input String the number indicates the length of potential input void conversion(char*name,int*add); printf("Input Sentence\n"); scanf("%[^\n*]c",string);//Where the string is actually input printf("Input length of keyword\n"); scanf("%d",&jlen); printf("Input keyword\n");

Vignere Cypher Encryption

  • Upload
    jalal

  • View
    3

  • Download
    0

Embed Size (px)

DESCRIPTION

A C code to implement the Vignere Cypher Encryption

Citation preview

//// vignere cypher encryption.c// EX 17//// Created by Cyrus Shadman Safdar on 4/8/15.// Copyright (c) 2015 Cyrus Shadman Safdar. All rights reserved.//

#include

#include

main()

{ int len,i,x,jlen,add[256],num,n; //Declaring Length of String x=3; char string[1024],j[256]; // Declaring the Input String the number indicates the length of potential input void conversion(char*name,int*add); printf("Input Sentence\n"); scanf("%[^\n*]c",string);//Where the string is actually input printf("Input length of keyword\n"); scanf("%d",&jlen); printf("Input keyword\n"); scanf("%s",j); conversion(j,add); len=strlen(string); n=0; for (i=0;i122) { string[i]-=26; } string[i]+=add[num]; n++; } } printf("%s\n",string); for(i=0;i