sir i am facing a problem when i decrypt my encrypted file the program add two symbols two dots(..) over y and u . plz help me
@SelfStudyTutorials Жыл бұрын
You may like to refer correct code at the following url cprogrampracticals.blogspot.com/2023/03/C-program-to-decrypt-a-text-file-using-Caesar-Cipher.html Let me know if you are facing any technical difficulties in executing this code. With best wishes
@aghaidyn Жыл бұрын
Hello, can u help me with this code?
@SelfStudyTutorials Жыл бұрын
Yes. I will. Share your error details or complete code to help you further.
@aghaidyn Жыл бұрын
@@SelfStudyTutorials So I have this problem where if u use "x, y, z" in the encryption code, the decryption will be random. For example I writed "YOUNG" and the shift is 3,the encryption will be " BRXQJ" which correct. However, the decryption text is "?OUNG" instead of "YOUNG".
@aghaidyn Жыл бұрын
@@SelfStudyTutorials And I tried to type "XYZ" with 3 shift too, the encryption is "ABC" but the decryption is ">?@".
@aghaidyn Жыл бұрын
@@SelfStudyTutorials This is my source code, Encryption: drive.google.com/file/d/1KSNelv2QF94Nq9MwwD2cIwVBFR4oCpZK/view?usp=share_link Decryption: drive.google.com/file/d/11Nm1qaArtq_awhTZ8cV9_Dwuxo0N01aq/view?usp=share_link
@SelfStudyTutorials Жыл бұрын
Dear SithReign, The problem faced by you can be solved using modulus 26 (%26) operation. Try to update your decryption.c while loop code as under: //Decrypting the message.txt //Declare one extra variable "char ch_temp" ch = fgetc(message); while(ch != EOF) { ch_temp = (ch-'a' - key+26) % 26 + 'a'; fputc(ch_temp, decrypt); ch = fgetc(message); }