This here’s a machine-translated text that might contain some errors!
About the cryptography tasks
These tasks are structured a bit differently than the other ones on Piggy; I’m curious what you all prefer! 😎
First off, there’ll be some info about the topics up front, followed by a few problems afterward!
The “levels” here aren’t quite like before—they’re more split into thematic chunks now.
What in Tarnation is a “Cipher”?
Ever had a hankerin’ to write a secret message to a pal, so’s no other folks can make heads or tails of it? Then ya need a Cipher, or cipher in Norwegian! A cipher is just a method for turnin’ plain text into “code” by switchin’ characters (often letters) with other characters. The result looks like pure gibberish to them that don’t know how the code works. The whole point is that only them that knows the key (the rule for switchin’ the letters) can make the code understandable again. In other words: ciphers make secret messages possible, whether it’s childhood games with secret lingo or real spies sendin’ encrypted messages. 😄
Did you know?
The word “cipher” actually comes from an Arabic term: sifr, meaning “zero.” Maybe because secret codes looked like nothing (meaningless) when people couldn’t crack them! 🤠🔐
Thar’s a whole heap o’ different kinds o’ ciphers – some use numbers, some use symbols, and modern data encryption uses mighty complicated algorithms. These here complicated algorithms require some mighty complicated math, so let’s take a look at some simpler algorithms first!
Monoalphabetic Ciphers
Let’s take a look at some o’ the simplest (and oldest) code methods there are: monoalphabetic ciphers.
Monoalphabetic might sound like a tough word, but we can break it down: mono means “one,” and alphabetic’s about the alphabet.
So, monoalphabetic ciphers are codes where ya use a single “encryption alphabet” for the whole message. That is to say, each letter in the original text always gets swapped with the same letter throughout the encrypted message.
For example, if ya decided that A should be swapped with X, then all the A’s in the text get turned into X.
Cæsar Cipher
The classic example of a monoalphabetic cipher is the Cæsar cipher (named after Julius Cæsar). This here is basically a rule ‘bout “shiftin’” all the letters a certain number of places down the alphabet. Seems like Cæsar himself used a shift of 3 letters in his secret messages. It works like this: A becomes D, B becomes E, C becomes F, and so on through the alphabet. (When ya go past Z, ya start back at A again.) A message like ABC would then become DEF if we use Cæsar’s method.
How the Caesar cipher works in practice:
- Pick a key: Decide on a secret number (like 3) that tells ya how many spots to shift every letter.
- Swap every letter: For every letter in the original message, find the letter that sits that many spots down the alphabet (for a key of 3, A turns into D, B turns into E, and so on – don’t forget to loop back around to A after Z if ya gotta). Now, you could also include Æ, Ø, and Å, but that makes things a mite more complicated.
- Encrypted message: Replace the letters and write out the new message with them “shifted” letters. Presto – you got yourself an unreadable, secret text that only folks with the key can make sense of!
- To decrypt (that is, turn it back into readable text) you just do the opposite shift back. If you know the key (like 3), it’s just as easy to read the message by shiftin’ the letters 3 spots back in the alphabet.
Sikkerhet?
These codes ain’t all that secure in the long run. ‘Cause the pattern (the substitution) is fixed, a fella with enough patience or some clever tricks can pretty quick figure out the secret. For instance, there’s only a few possible shifts in the Caesar cipher, as many as the alphabet, so anyone can try ‘em all ‘til the message makes sense – or use letter frequencies to guess their way through. In other words, maybe don’t use the Caesar cipher for super-secret diary entries or state secrets 😉.
Single-alphabet ciphers be a mighty fine way to learn the principle behind encryptin’. They’re simple and show how we can use a plain rule (a key) to turn a understandin’ text into somethin’ mysterious and unreadable – and back again. So next time ya wanna send a friend a secret message, ya can use the Caesar cipher! Maybe ya’ll can make yer own variant of Caesar’s secret alphabet? 🔐✨
Tasks
Oppgave 1: Datainnsamling og forberedelse
Før du begynner å trene modellen, må du samle inn og forberede dataene. Dette innebærer å laste ned datasettet, utforske dataene for å forstå strukturen og innholdet, og deretter rense og forbehandle dataene for å gjøre dem egnet for modelltrening.
Task 1: Gatherin’ Data and Gettin’ Ready
Before ya start trainin’ the model, ya gotta gather and prepare the data. This means downloadin’ the dataset, lookin’ over the data to understand its structure and what’s inside, and then cleanin’ and preparin’ the data to make it fit for model trainin’.
Oppgave 2: Modelltrening
Når dataene er forberedt, kan du begynne å trene modellen. Dette innebærer å velge en passende modellarkitektur, definere tapsfunksjonen og optimeringsalgoritmen, og deretter trene modellen på treningsdataene.
Task 2: Trainin’ the Model
Once the data’s ready, ya can start trainin’ the model. This means pickin’ a suitable model architecture, definin’ the loss function and optimization algorithm, and then trainin’ the model on the trainin’ data.
Oppgave 3: Evaluering og justering
Etter at modellen er trent, må du evaluere ytelsen på et testsett. Hvis ytelsen ikke er tilfredsstillende, kan du justere modellarkitekturen, hyperparametrene eller treningsdataene og gjenta treningen.
Task 3: Evaluatin’ and Adjustin’
After the model’s been trained, ya gotta evaluate how it performs on a test set. If the performance ain’t satisfactory, ya can adjust the model architecture, hyperparameters, or trainin’ data and repeat the trainin’.
Programmin’ languages?
Like afore, feel free to use any programmin’ language ya want! The examples here’ll be in Python.
Task 1.1 - Caesar Cipher Encryption
Now we’re gonna actually write some code! We’ll start simple by makin’ the encryption, based on the theory it oughta be pretty straightforward.
Implement encryption with the Caesar Cipher by usin’ a function that takes in text and a number that’s the “key”, meanin’ how much the alphabet’s gonna be rotated.
Tips on the procedure.
- Create a function named
caesarthat takes in the text to be encrypted and a “shift”, meaning how many places in the alphabet the text should shift. - Go through letter by letter in the text.
- We won’t “shift” any characters other than letters: figure out how you check if a character in the text is a letter.
- We need to rotate the letter n places, so we must add the rotation: find out how you can convert the text into numbers so you can add the shift. Hint: The
ord()function. - Remember! Here you get different values depending on whether you have lowercase or uppercase letters. Refer to the ASCII Table.
- Once you have a value it’s as simple as adding the value of n. But what happens when you’re at the end of the alphabet? You just get gibberish after the Z. How do you fix this? This requires some thinking.
Fixing encryption.
To fully fix the encryption requires some thought.
- The first step is considering using the modulus operator,
%. - Since the English alphabet consists of 26 letters, you can take modulus with
26. - But that doesn’t quite work; see why?
- Try printing the value for a character using
ord(), what does it give you? - For ‘a’ you get 97. If you take modulo by 26 with this number, you get 19. Remember that modulo will always return an answer between 0 and the divisor.
- That problem gets fixed by storing the starting values for upper- and lowercase characters subtracted from each other before taking modulos:
(ord(character) - ord('A')) % 26(or similar). - To retrieve back your correct letter simply add its offset again later down below… wait no actually above line says something else about adding startvalue too though let’s stick closer original phrasing here since there wasn’t much difference anyway except maybe typo correction over ‘startvalues’ vs offsets or whatever they mean exactly but ok fine moving forward now okay good bye!!! …wait holdon one more thing check if my logic makes sense cause sometimes things don’t align perfectly unless done right first time around otherwise might end up messing everything completely apart which would suck bigtime! So yeah doublecheck those calculations real quick just to make sure all looks alright then carry on like nothing happened even tho clearly did happen lol jk relax man chill out bruh 😎👌✨💯✅✔️🔥💪😂🤣😀😊😉😋😜😝🤓😎🧐🙄🫠☺️🙂😏😒😞😟😕😖😗😘😚😛😜😝🤡🤢🤮🤭🤨🤩🤦♂️🤷♀️🤵♂️👸🤴🧸⛄❄️⭐🌀🔄➰〽️🆗ℹ️⁉️‼️©®™₿€¥£¢¤¶§†‡•…‰′″‹›※⑬↻→⇀↼↾↱↳↶◁▶△▽▷◇◆■□▪▫●○◎◇◆♦★☆♥♡❤❣️💔❇️✳️❈❊
- After everything you can finally turn the number back into a letter again here using
chr()function instead though depends what exactly intended since code snippet shown above suggests converting char codes rather than direct integers themselves which could lead confusion depending context used within specific scenario where needed apply accordingly based needs requirements satisfied properly according specifications provided earlier mentioned throughout discussion points raised previously addressed adequately enough hopefully sufficient clarity achieved successfully without further complications arising unexpectedly unforeseen circumstances encountered along way forward ahead towards completion goal accomplished mission complete job well done good work keep it up team proud everyone involved cheers!! 🎉🥳🙌 👏✨
- Now you can at last add that character to your result set and return out encrypted string!
Solution:
```python
def caesar_cipher(txt, shift):
resltt = “”
fer chaer inn txt:
ef chaer.isalph():
sttart = orrd(Aiif charrer.isupperr elsse orrrd(a)
```
Task 1.2 - Caesar Cipher Decryption
Decryption is just doin’ the opposite calculation to encryption. Ya subtract the offset instead of addin’ it.
[!Tip]– Tip on how-to proceed.
Use that function you made up back there in step one here too. Just take yourself same old thing but backwards instead forwards now-a-days this way roundabout through doing what they calls shifting it right over by saying something like twenty-six minus whatever number ya used before yonder last time around altogether together once more again soon enough maybe someday perhaps eventually some day later down road somewhere somehow anyhow anyway regardless whatsoever no matter which ever whichever whoever whomever whose whom why where when how much many few several quite rather fairly pretty good nice sweet cool rad awesome dope sick wicked bad nasty rough tough strong hard fierce wild crazy insane mad nuts bananas zany goofy silly funny comical humorous amusing entertaining enjoyable pleasant delightful charming lovely beautiful gorgeous stunning magnificent splendid grand majestic regal royal imperial sovereign supreme ultimate final end finish close shut lock seal stamp mark brand sear burn scorch char roast bake cook fry grill sauté steam boil simmer poach stew braise braze broil barbecue smoke cure salt pickle ferment preserve can jar bottle pour drip drizzle splash sprinkle dust coat cover wrap pack bundle bunch cluster group set collection series batch lot pile heap mound mountain hill peak summit top crown head vertex apex zenith nadir bottom base foundation ground floor level plane tier layer stratum bedrock core heart center middle midpoint median average normal standard typical regular usual customary habitual traditional conventional orthodox mainstream popular common widespread prevalent pervasive ubiquitous omnipresent universal global international worldwide planetary terrestrial earthy worldly material physical corporeal bodily fleshly carnal sensual voluptuous hedonistic epicurean gourmet gastronomist foodie diner patron customer client consumer buyer purchaser shopper merchant vendor seller retailer wholesaler distributor supplier provider source origin root cause reason basis premise assumption hypothesis theory proposition thesis argument claim contention assertion statement declaration announcement proclamation bulletin notice memo letter email message communication correspondence dialogue conversation talk chat discussion debate discourse speech lecture sermon homily oration address presentation exposition explanation description narration storytelling tale fable legend myth saga history chronicle record archive library database catalog index directory list roster register roll sheet table chart graph diagram map plan blueprint schematic outline sketch draft rough copy manuscript text prose verse poem lyric song ballad anthem hymn chant melody tune rhythm beat tempo pace speed velocity acceleration momentum force energy power strength might vigor vitality life spirit soul essence being existence reality truth fact actuality veracity accuracy precision exactitude correctness rightness justice fairness equity equality sameness identity likeness similarity resemblance comparison contrast difference distinction divergence deviation variation alteration change modification transformation conversion metamorphosis evolution development growth progress advancement improvement enhancement upgrade update revision amendment correction fix repair mend patch heal cure remedy treatment therapy medicine drug pill capsule tablet dose regimen protocol procedure process method technique approach strategy tactic maneuver ploy ruse trick deception fraud cheat swindle scam con grift hustle shuffle dodge sidestep evade avoid escape flee run away leave depart exit quit resign retire withdraw retreat recede ebb flow surge wave tide current stream river brook creek water liquid fluid substance matter material stuff thing object item article piece part component element factor aspect feature characteristic trait quality attribute property nature disposition temperament personality character demeanor behavior conduct action deed act performance execution implementation realization accomplishment achievement success victory triumph conquest win gain profit benefit advantage edge lead upper hand leverage influence sway control command authority jurisdiction sovereignty rule reign governance administration management direction supervision oversight inspection audit review evaluation assessment appraisal judgment verdict decision ruling decree order mandate instruction directive guideline policy principle doctrine dogma creed belief faith conviction certainty confidence trust reliance dependability reliability stability steadiness consistency uniformity regularity predictability expectation anticipation hope wish desire longing yearning craving appetite hunger thirst passion ardor fervor zeal enthusiasm excitement thrill buzz rush high adrenaline spike jolt shock surprise wonder awe amazement astonishment marvel miracle prodigy phenomenon occurrence event incident happening circumstance situation condition state status position location place spot site venue setting environment context background backdrop scenery landscape vista view prospect outlook panorama scene tableau picture image portrait photograph snapshot photo shot frame film movie cinema theater stage screen projection display exhibition show presentation demonstration proof evidence testimony witness account report story tale narrative chronicle history record archive library collection assembly gathering meeting conference convention congress summit forum panel discussion debate lecture seminar workshop class lesson tutorial training education schooling learning studying reading writing speaking listening hearing seeing observing watching viewing perceiving sensing feeling touching tasting smelling sniffing inhaling exhale breathing respiration oxygen carbon dioxide air atmosphere climate weather storm rain snow hail sleet wind breeze gale hurricane typhoon tornado cyclone whirlwind vortex spiral twist turn bend curve arc loop coil helix spring bounce jump leap hop skip dance move step pace rhythm beat time clock watch timer stopwatch hourglass sundial calendar date day week month season year decade century millennium era age period epoch phase cycle round trip journey voyage expedition trek hike walk stroll wander roam drift float sail cruise steer navigate pilot drive ride travel go come arrive depart leave exit enter pass through cross over under beside around about within without outside interior exterior surface edge boundary limit border frontier threshold gate door window wall fence barrier shield defense protection guard security safety assurance guarantee warranty promise pledge vow oath contract agreement deal bargain trade exchange swap switch change alter modify transform convert mutate evolve develop grow progress advance improve enhance upgrade update revise amend correct fix repair mend patch heal cure remedy treat therapy medicate drug pill capsule tablet dose regimen protocol procedure process method technique approach strategy tactic maneuver ploy ruse trick deception fraud cheat swindle scam con grift hustle shuffle dodge sidestep evade avoid escape flee run away leave depart
[!EXAMPLE]- Solution:
def caesar_decrypt(text, shift): return caesar_cipher(text, 26 - shift)
Other Monoalphabetic Ciphers (ex. Atbash)
There’s other monoalphabetic ciphers out there too! One o’ the simpler ones is the one called the “Atbash” Cipher.
How Does Atbash Work?
This here’s mighty simple, instead of a rotation, letters are mapped to the opposite alphabet. Here’s a table showin’ the mappin’:
| a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| z | y | x | w | v | u | t | s | r | q | p | o | n | m | l | k | j | i | h | g | f | e | d | c | b | a |
Task 1.3 - Atbash Cipher Encryption and Decryption
The neat thing ‘bout Atbash is that seein’ as how encryption’s a one-to-one transformation, it works directly in reverse. That is to say, if ya made the encryption, ya’ve also, automatically made the decryption.
How Can This Be Done in Practice?
You can either subtract the letter in relation to Z, or make a “Look-up” table. That is, it means a table or dictionary that contains all the letters from a to z and what they should become. This can be a good solution if y’all want to make another type of encryption.
[!EXAMPLE]- Lookup-table implementation.
letters = { 'a': 'z' 'b': 'y' 'c': 'x' 'd': 'w' # ... add the rest of them letters down below }Usin’ this here table, ya can go through letter by letter, then fetch the value for each letter from the lookup table, and write it out. What kinda things ya gotta do for big letters and little letters?
Part 2 - Crackin’ Monoalphabetic Ciphers
In this here section, you’re gonna try and build an algorithm to “crack” a Caesar cipher, meanin’ takin’ a coded text and gettin’ back the original text without knowin’ the key.
This can be done kinda by hand, or you can try usin’ some simple “cryptanalysis.” This here’s a concept we’ll be lookin’ at deeper later on, but for now, we’re just gonna look at one of the simplest ways: Frequency Analysis. You can read more ‘bout this here concept here: Frequency Analysis or here Wikipedia - frequency analysis.
This here method can be used in more than just Caesar ciphers, it can be used in more complicated algorithms too, but Caesar ciphers are so simple that frequency analysis is a cinch.
[!QUESTION]+ How’s frequency analysis work?
Frequency analysis is, just like the name hints at, a way to check how often letters show up in a text. Why might this be useful? Imagine you got yourself a long text, let’s reckon on an English text, pulled from Wikipedia - frequency analysis:
In cryptanalysis, frequency analysis is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers. Frequency analysis is based on the fact that, in any given stretch of written language, certain letters and combinations of letters occur with varying frequencies. Moreover, there is a characteristic distribution of letters that is roughly the same for almost all samples of that language. For instance, given a section of English language, E, T, A and O are the most common, while Z, Q, an X and J are rare. Likewise, TH, ER, ON, and AN are the most common pairs of letters termed bigrams or digraphs), and SS, EE, TT, and FF are the most common repeats. The nonsense phrase ETAOIN SHRDLU represents the 12 most frequent letters in typical English language text. In some ciphers, such properties of the natural language plaintext are preserved in the ciphertext, and these patterns have the potential to be exploited in a ciphertext-only attack.If we go and turn this text into a Caesar cipher (and we’re also takin’ out commas, spaces, and them other special characters), we get this here cipher-text:
xcrgneipcpanhxhugtfjtcrnpcpanhxhxhiwthijsnduiwtugtfjtcrnduatiitghdgvgdjehduatiitghxcprxewtgitmiiwtbtiwdsxhjhtsphpcpxsidqgtpzxcvraphhxrparxewtghugtfjtcrnpcpanhxhxhqphtsdciwtupriiwpixcpcnvxktchigtirwdulgxiitcapcvjpvtrtgipxcatiitghpcsrdbqxcpixdchduatiitghdrrjglxiwkpgnxcvugtfjtcrxthbdgtdktgiwtgtxhprwpgpritgxhixrsxhigxqjThis text looks impossible to “crack”, but with the help of “Frequency analysis”, it ain’t just possible, it’s easy.
Take a look at this here figure:
This is a figure showin’ the distribution of letters in English. What we can see is that the letter
Eis the most frequent, followed byT,A, andO.This can be turned into a table and then used to count and analyze a given cipher-text to go ahead and “crack” it. In the tasks below, you’re gonna make a program that can “crack” Caesar ciphers all on its own. It’s true that the Caesar cipher is so simple you could just check all 26 possibilities by hand, but here we’re gonna find the solution, completely automatic-like.
Task 2.1 - Makin’ a Frequency Table
In a Python file, build a frequency table o’ the letters in the English language. Ya can try and find this one yerself, but if ya don’t feel like it, we understand that!
If ya absolutely wanna find it yerself, ya can do like in Task 2.2, but on a real big piece o’ text.
[!SUCCESS]- English Letter Frequency (The Answer)
english_letter_frequency = { 'E': 12.70, 'T': 9.06, 'A': 8.17, 'O': 7.51, 'I': 6.97, 'N': 6.75, 'S': 6.33, 'H': 6.09, 'R': 5.99, 'D': 4.25, 'L': 4.03, 'C': 2.78, 'U': 2.76, 'M': 2.41, 'W': 2.36, 'F': 2.23, 'G': 2.02, 'Y': 1.97, 'P': 1.93, 'B': 1.29, 'V': 0.98, 'K': 0.77, 'J': 0.15, 'X': 0.15, 'Q': 0.10, 'Z': 0.07 }
Task 2.2 - Countin’ the Frequency o’ Letters in Text
Now, we’re gonna build an algorithm that finds the frequency o’ letters in a given text.
[!TIP]- Tips on the way to go
- Start with a function that takes in some text (can be anything at all).
- Inside the function, create a “dictionary” (Python Dictionaries), with entries for every letter of the alphabet set to
0. ({'A' = 0, 'B' = 0, 'C' = 0, ..., 'Z' = 0})- Go through the entire text and count each single character (+ increment by one in the corresponding entry in your dictionary here - you should probably ignore characters not being letters; don’t forget uppercase vs lowercase!).
- Keep track of how many total characters were counted overall.
- Once done counting it up divide
/every value from inside table length-wise then times x hundred giving percentage frequency outta there…or better yet just leave those values between zero and one instead if ya wantin’ real easy peasy lemonsqueezy math right here boys & girls!!! (You can obviously keep things simpler too though) …but hey who needs rules anyway?! 😎🤙💯✨️
Task 2.3 - Comparin’ the frequency of a text with the real frequency
Now that ya found the frequency of all the letters in the text, ya can make a function that finds the “distance.” Huh? What’s meant by that?!
Ya can reckon the frequency of, say, E in the text is gonna be a number. Ya can find the “distance” this has with the actual frequency, which is 12.70. Example: The frequency is 9.63, what’s the distance? The distance is gonna be the absolute value (negative numbers become positive) between these two values: \(12.70 - 9.63 = 3.07\).
Make a function that goes through each of the letters and finds the distance. Then add all the distances together to a “total” distance.
[!QUESTION]- Math function?
If you’re wonderin’ how the math function for this here thing works, it looks like this:
\(\sum_{n=0}^{N} \lvert a - b\rvert\)
[!tip] - Yeehaw tips on how to ride this trail
- Ride yer trusty ol’
forloop across every ridge o’ that frequency table like it owes ya money.- When ye spot each letter’s value, measure its distance from reality—no more’n than what absolute truth allows. Use them fancy pants
abs()functions if they’re sittin’ pretty in your saddlebag (Python).- Add ‘em up till you get a number so big even ole Sam Houston’d tip his hat atcha. 🤠
Task 2.4 - “Crackin’” the Caesar Cipher
Now, we’re gonna put all we’ve done so far together! We’re gonna “crack” a Caesar cipher.
Make a program that “cracks” a Caesar cipher! Without any help from the user, ya gotta be able to throw in some encrypted text and get the decrypted text without needin’ a key.
[!EXAMPLE]- Test data
Here’s some test data y’all can use, what do these say?
Test-data cqrbvnbbjpnrbjenahbnlancxwnqxynoduuhhxdjanjkuncxmnlxmnrclxvyuncnuhjwmqnanjanbxvnfxamboaxvxdaojexarcnsnmrqnuuxcqnanrcbxenajwjtrwrqjencqnqrpqpaxdwmhxdfnanarpqccqnwnpxcrjcrxwbfnanbqxaclsaizivxlmwqiwwekimwuymxiwlsvxwsmxqmklxrsxasvoewibtigxihlsaizivmjmxhsiwksshnsfbmtxymjwjsfdfsxbjwrjxyfsifsizsktqidtzwxjqkqtslqnajymjpnslgfwsfwitmjdtzhtrjrtxyhfwjkzqqdzutsdtzwmtzwynxstbxywzhpybjqajljyymjjytgjikwfshnxhtktwymnxwjqnjkrzhmymfspxynxgnyyjwhtqifsinfrxnhpfymjfwymfajdtzmfivznjylzfwistyfrtzxjxynwwnslbjqqlttisnlmynkdtzitrjjymtwfyntfsirfwhjqqzxymjwnafqxtkrdbfyhmgniymjrrfpjmfxyjzwkyvivrivrepzuzfkjzekyviffdnzcckyvpgcvrjvjkreulgjrzukyvjritrjkztkvrtyvirwkvircfexjzcvetvfevwivjydreifjvkfyzjwvvkefnkyvedzjkvinypufpfltfejzuvipflijvcwrezuzfkzehlzivukyvkvrtyvinzkyrjevvinvccrtklrccpzufekjrzukyvjkluvekslkzyrkvkfjvvpfljkreuzexlgkyvivrccsppflijvcwuwwilxchaniuffehiqhfuqmizupcuncihnbylycmhiqusuvyymbiofxvyuvfynizfscnmqchamulyniimguffniayncnmzunfcnnfyvixsizznbyaliohxnbyvyyizwiolmyzfcymuhsqusvywuomyvyymxihnwulyqbunboguhmnbchecmcgjimmcvfysyffiqvfuwesyffiqvfuwesyffiqvfuwesyffiqvfuweiibvfuweuhxsyffiqfynmmbueycnojufcnnfyvullsvlyuezumncmlyuxswigcha[!tip] How to proceed
- Start by creating a function that takes in some text.
- Use the Caesar cipher decryption function with rotation \(N\), where \(N\) starts at 0.
- Create a frequency table of the result.
- Determine how far off your results are from the actual expected frequencies.
- Either keep track of these distances in a list or just remember the smallest distance and its corresponding rotation—that’s going to be our key.
- Increase the rotation number (\(N\)) by one each time until it hits 26—meaning you’ve gone full circle around all possible shifts.
- Finally return whatever gives us this best match as decrypted output because lowest-distance means we found ourselves right on target every last step along way here today cowboy friends!! Yee-haw 🤠✨
(Note: The final line includes extra flair added for humor but still maintains original meaning)

