C :: Write A Code About Caesar Cipher Shift And Using ASCII With It
Dec 5, 2014
I am struggling to write a code about caesar cipher shift and using ascii code with it. For example letter b should be replaced with the letter c and using the ascii code it should be from 98 to 99 and so on..
I am making a simple caesar cypher with a 2D array. I have to make a function for the key shift so
key=5 ABCDEFGHIJKLMNOPQRSTUVWXYZ FGHJKL...ABCDE
Function Name: Key_Array This function uses the random key value to make a key array Passed: value = random key value Returns: alphabet = rearranged alphabet
[Code] .....
I am having trouble outputting the rearranged alphabet to the screen also.
I get the error of not declaring "text" "exit" but I how do I declared those variables, even if they cause problem to file... How can I output the decipher file in a new text...?
I have managed to print out the encrypted text from the console, however it doesnt decrypt correctly and isn't returning the correct key. I can't seem to find the error that is causing the decrypted text from printing correctly. When I try to decrypt the text it changes it completely as well.
The assignment is to open an encrypted file, count the occurrence of each alphabetic character in the file. find the highest occurring letter and use that to find the shift, then apply the sift to the file in order to decipher and then print out the deciphered txt.
#include <fstream> #include <iostream> #include <string> using namespace std; int main(){ string word; ifstream txt; int arr[26] = { 0 };
is it possible to write a code that can crack the sha256 hash when you know the form of password? for example the password form is *-********** which is 12-13 characters long and the first char is one number from 1 to 25, second one is hyphen and in each char from the third one to the end, you can put a...z, A...Z and 0...9 and after guessing each pass, the code convert the pass to sha256 and see whether the result hash is equal to our hash or not and then print the correct pass. I know all possible numbers is a big number ((26+26+10)^10) but I want to know that: 1- Is it possible to write such code? 2-if yes, is it possible to run whole code in less than one day(because I think it takes a lot of time to complete the whole code)? 3-Since I can't ask you to write a code for me, how and where can I ask for this code? 4-if no, is it possible to write such code in other programming languages?
I'm trying to write a code to calculate the minimum number of coins needed to cover a change. It works fine but i want to display a message telling the user to try again if they type something that's not a number or a negative number. But it's not working. When i type a negative number, the program runs normally and displays a negative value of coins instead of showing the message. And when i type something that's not a number, the program just keeps showing a lot of zeros nonstop. And when i try to compile it with 'unsigned float' instead of just 'float' i get errors.
Code:
#include <stdio.h> int main() { unsigned int coins; float change; unsigned int n25, n10, n5, n1; unsigned int r25, r10, r5; }
I am trying to write code to find all the prime numbers before a user entered number. I started with a working program and when I tried to create a function, it got all messed up.
Code:
#include <stdio.h> int is_prime( int num ); int get_positive_integer(void); int main( ) { int upper; /* upper limit to check */ int num; /* current number to check */ int isprime; /* used to flag if number is prime or not */
im trying to write a source code that find the smallest, largest and average of numbers in array. the code runs fine, but it is not giving the highest number and the the average should include only four number excluding highest and smallest number from the array.
void OlympicJudging() // Olympic Judging { int numbers [6]; double average, sum = 0; int temp; for(int i = 0; i < 6; i++){ cout << "Please type a value for scores: "; cin >> numbers[i];
so i need to encrypt a txt document using Caesar encryption. however i don't know how to open a txt and shift the keys into a new txt. the program has to ask the user for the number it should shift. Using arrays, if else. i also need to make a menu so i am using switch.
I was assigned to make a vigenere cipher using the function void vegenere(char* to_encrypt, char* key, char* encrypted) I got it to work for the encryption but i have to be able to decrypt the phrase too. I was assigned to write in a flag which indicated encryption or decryption. I tried to implement this but now it wont decrypt and i dont know why, all it does is put the same copy of decryption (which is really encrypted) multiple times until it crashes.
Ok i found my dumb error of putting decrypt on an infinite loop which i fixed by putting it into the if statement after the encryption output. However now it says that the encrypted and decrypted outputs are identical without decrypting the ciphertext
I finished my Enigma cipher simulator...how should I write the error handling code? Should I throw an exception in main, or in the Enigma ctor and Encrypt() fn when the user enters a non-alphanumeric character?
Let's say I have unsigned char test[10] = "HELLO!!!"; How would I go about circularly shifting this to the right? Inline assembly instructions would be ok too
I have this BCD string: 890123...78FFF and need to right shift by say 3 nibbles, resulting in: FFF890123...78 length is fixed, number of 'f' nibbles are varying.
when we are trying to shift one tab to other one event should occur, can any one tell what is the event,how and where we have to write the event? give example. if he successfully login in first tab only then second tab will open,if he doesnt login in first and tries to open the second tab message should appear...
And while moving the bits till the size of the integer, it fills the LSB with 0's and as 1 crosses the limit of integer, i was expecting the output to be 0.
Nothing complicated, and it works well ... except one thing: when I press the shift key and the mouse is moving by SetCursorPos, is moving pretty slow ... why ? I can not figure out why ! For testing, I attached the test project ...
i want to create 100 gmail accounts instantaneously....what i want from you guys is i have written a program that create a text file i want that once i give the program the imput of 1 it should delete the first 3 lines from the file i.e. the first account details coz that is already been created and shift the rest of it 3 lines upwards after that i'll write a javascript that will automatically fill and create the accounts with those names in web browser.....my lil program is here:
I have some ascii characters in a char variable.ex - char buf[100]="ab*(z&";
So each of the char in that char array will have some hex value.ex- *'s hex value is '2a'.
And I have a long long int variable in which there is a 64 bit hex value.
ex- long long int k=0x0000888888888888;
Now i want to subtract the char buff's hex value in k. How to accomplish it.
That is 0x0000888888888888 - 0x000061622a287a26 = 0x000027265e600e62 (final result in a buffer or a long variable is okay)
Later i want to reverse the result as 26e006e56272.It should be stored in a variable such that i should be able to access each byte from it(ex- '72'(last 2 hex digits))