Tag: Bash scripts

  • Decryption of Caesar Cipher using highest letter frequency Approach

    Research shows that the letter “E” is the alphabet’s most commonly used vowel. “E” is shown to have a frequency of 11.51% in all words analyzed. To decrypt a Caesar cipher using the highest letter frequency approach, you can follow these steps: Detail explanation: cipher.txt Result: ./freq_compare cipher.txtdictionary loadedcipher.txt loadedLetter with the highest count: lCount:… Read more

  • Decryption of Caesar Cipher using Dictionary-Based Approach

    By evaluating all 25 decrypted messages, we can identify the correct one by examining its resemblance to English text rather than mere random gibberish. Unix/Linux systems come with a dictionary file. I am using Ubuntu and the dictionary locates at /usr/share/dict/cracklib-small, which contains an extensive collection (54763 words) of English words. To facilitate the process, a… Read more

  • Caesar cipher by Bash scripts

    The Caesar Cipher, used by Julius Caesar around 58 BC, is a substitution cipher that shifts letters in a message to make it unreadable if intercepted. To decrypt, the receiver reverses the shift. To encrypt or decrypt text using the tr (translate) command in Bash, you can define a mapping of characters to new characters and apply it… Read more

  • Useful Bash Scripts

    Prompt the user to press the Enter key before proceeding with the script execution. Check if a variable is empty Transform any uppercase letters in the input word to their corresponding lowercase letters. # hello world Assign the current date to the variable date in the format “YYYYMMDD”. Find string length Extract substring Detailed explanation: # April Find and… Read more

  • Bash Scripts Basic

    The term “shell” encompasses any software program that offers a command-line interface to interact with an operating system. Among various types of shells, “Bash” is a popular one extensively utilized in Unix/Linux systems. A bash script is a file that ends with the “.sh” extension and contains a series of commands and logic controls. When… Read more