Hello Everyone Help needed, Has anyone implemented frequency analysis attack on caesar cipher in PHP and predicting the possible key for it. it should input the cipher text and predict the key using frequency analysis chart.

Member Avatar
Member Avatar
+0 forum 2

Python's double ended queue module makes Caesar's cipher easy.

Member Avatar
Member Avatar
+1 forum 1

So, I have attached my code below. It worked fine , until I introduced the part to print out what's in the input file. After I did this, it says it's completed, but I doesn't copy the content in the output file. What should I change? Thanks a lot /*Program to read from a text file, encrypts the content with an offset FILE *file_input, *file_out; char input_name[20], output_name[20]; char content; int off_key; file_input = 0; while (file_input == 0) { printf("Please write the name of the file you want to open and get the input from: \n"); gets(input_name); file_input = …

Member Avatar
Member Avatar
+0 forum 3

So, I've been through a class in java so I know a little bit of what I'm doing... The assignment I have is to create a program that takes a string and converts the letters four away in the alphabet (ie: a becomes e and so forth). I've gotten most of my kinks worked out on my own, but you'll notice my encode and decode are different, I had it set up the way I do for my decode at first and switched to the method I am using in my encode in an attempt to fix my problem with …

Member Avatar
Member Avatar
+0 forum 4

I am doing code for CAESAR CIPHER. I need to built a histogram or frequency distribution for the output. I thought that finding out the frequency of the ASCII code, then print the frequency with * by using loop. But my code din't have array, can't do ++freq[c[i]]. I have no idea. Anyone can help? #include <stdio.h> #include <iostream.h> void encrypt(int shift); int main() { int shift; int decOrEnc; printf("Enter shift amount (1-25): "); scanf("%d", &shift); if (shift < 0) { printf("Bad Input."); return 0; } printf("Type 1 to Encrypt or 0 to Decrypt: "); scanf("%d", &decOrEnc); if (decOrEnc != …

Member Avatar
Member Avatar
+0 forum 2

I have problem with this part of the code private char encryptChar(char c, int shift) { if (Character.isLetter(c)) return (char) ('A' + (c - 'A' + shift) % 26); else return c; } private String encryptMessage(String msg, int shift) { String result = ""; for (int i = 0; i < msg.length(); i++) result += encryptChar(msg.charAt(i), shift); return result; } and for encoding and decoding if (clientMsg.equals("ENCRYPT")) { System.out.println("Enkript"); opw.println("OK"); // send ok to client opw.flush(); // take the message from the server and send it back String text = br.readLine(); System.out.println(text); int shiftmsg = 26 - moving; opw.println(encryptMessage(text, shiftmsg)+"\n"); …

Member Avatar
Member Avatar
+0 forum 1

Although, I could easily state quite a few people will be bored with these, I couldn't find someone else with my problem. The code below runs, though doesn't decrypt. It gets to the first "Error: Unidentified Character" and ends. Any help great appreciated. [CODE]#include <iostream> #include <string> #include <array> #include <iomanip> #include <fstream> #include <cstdlib> //Defines the namespace using namespace std; int iteration = 0; int size = 375; //char *textReadIn; string userHold = "q"; //Ask the user to input the shift number. //loads the specified file. char inputFileName[50] = "task_1.txt"; //opening pointer ifstream inputFile; //decryption function which takes the …

Member Avatar
Member Avatar
+0 forum 2

hey guy's I'm relatively new to C++ and I've been asked to make a Caesar Cipher. I'm supposed to take an encrypted .txt file and output it's decryption. I've sort of got an idea of my flow as shown below but I'm confused as to how to transform capitals in the encrypted .txt file into lower case so I can process them normally. I know I have to use "tolower", does that mean I have to include the header for it as well? Here's my code so far, am I on the right track? I'm not seeing any errors right …

Member Avatar
Member Avatar
+0 forum 1

Here is capital letter style caesar crypted message. We can simply try all possible shifts for first few words (ignoring punctuations, which is left as is). If both first words succeed we assume we cracked it. You could also use Vigenère encryption, but keeping non-letters is less simple, our Vigenère drops all non-letters (including numbers). You need some english word dictionary saved as dict.txt in same directory as you save this code.

Member Avatar
Member Avatar
+1 forum 1

I'm attempting to create a one line Caesar cipher decryption program in python and i'm afraid i've come to the end of my knowledge and well past it. this is the closest working code i've got: [code]def test3(): print("The decrypted text is: "+"".join(map(lambda x: chr(ord(x)+y),x)))[/code] as you can see it requires me to define x and y (the input text and the shift amount respectively) before hand. this wont do, next i tried this (and several variations of) [code]def test4(): print("The decrypted text is: "+"".join(map(lambda x=input("text: "),y=eval(input("shift: ")): chr(ord(x)+y),x)))[/code] but x is undefined globally the function should run as follows: …

Member Avatar
Member Avatar
+0 forum 5

The End.