0% found this document useful (0 votes)
198 views24 pages

Information Security Assignment: Cipher Analysis

Uploaded by

k224230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views24 pages

Information Security Assignment: Cipher Analysis

Uploaded by

k224230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Student ID: 22K-4230

Student Name: Muhammad shahaf


Course: Information Security
Section: BCS-7D
Assignment: 01
Task 1: Frequency Analysis
-Installing, unzipping and navigating into the main folder.

-Running [Link] to know the occurrences of bigrams, trigrams in


[Link]
-By referring to [Link] it’s known that
‘THE’ is the most used trigram and it is a good practice to first try to decode
trigrams to cover majority of the attack surface.
-Since ‘ytn’ is the most recurring trigram in [Link]; I used ‘tr’ command
to convert ‘ytn’ to ‘the’ due to reasons above.

T
-In above image you can see, I opened 3 terminals side by side to use ‘tr’
command and immediately see the new files to verify if the change I made was
correct or not, so far going good. Referring the trigrams from this:
[Link]

-The final file is [Link]


The final decoded ‘[Link]’ file content is at the next page.
THE OSCARS TURN ON SUNDAY INITIATIVES LAUNCH THEY NEVER INVOLVES TORTURED SPECULATION
WHICH SEEMS ABOUT RIGHT AFTER INTENDED IT TO BE JUST AN ABOUT WHICH FILM WOULD MOST
THIS LONG STRANGE AWARDS SEASON LIKELY BE VOTERS
AWARDS TRIP THE BAGGER FEELS CAMPAIGN OR ONE THAT BECAME SECOND OR THIRD FAVORITE AND
LIKE A NONAGENARIAN TOO ASSOCIATED ONLY WITH THEN EQUALLY TORTURED
REDCARPET ACTIONS INSTEAD CONCLUSIONS ABOUT WHICH
THE AWARDS RACE WAS A SPOKESWOMAN SAID THE GROUP FILM MIGHT PREVAIL
BOOKENDED BY THE DEMISE OF IS WORKING BEHIND CLOSED
HARVEY WEINSTEIN AT ITS OUTSET DOORS AND HAS SINCE IN IT WAS A TOSSUP BETWEEN
AND THE APPARENT IMPLOSION OF AMASSED MILLION FOR ITS LEGAL BOYHOOD AND THE EVENTUAL
HIS FILM COMPANY AT THE END DEFENSE FUND WHICH AFTER THE WINNER BIRDMAN
AND IT WAS SHAPED BY GLOBES WAS IN WITH LOTS OF EXPERTS
THE EMERGENCE OF METOO TIMES FLOODED WITH THOUSANDS OF BETTING ON THE REVENANT OR
UP BLACKGOWN POLITICS DONATIONS OF OR LESS FROM THE BIG SHORT THE
ARMCANDY ACTIVISM AND PEOPLE IN SOME PRIZE WENT TO SPOTLIGHT LAST
A NATIONAL CONVERSATION AS COUNTRIES YEAR NEARLY ALL THE
BRIEF AND MAD AS A FEVER FORECASTERS DECLARED LA
DREAM ABOUT WHETHER THERE LA LAND THE PRESUMPTIVE
OUGHT TO BE A PRESIDENT NO CALL TO WEAR BLACK GOWNS WINNER AND FOR TWO AND A HALF
WINFREY THE SEASON DIDNT JUST WENT OUT IN ADVANCE OF THE MINUTES THEY WERE
SEEM EXTRA LONG IT WAS OSCARS THOUGH THE CORRECT BEFORE AN ENVELOPE
EXTRA LONG BECAUSE THE MOVEMENT WILL ALMOST SNAFU WAS REVEALED AND THE
OSCARS WERE MOVED TO THE CERTAINLY BE REFERENCED RIGHTFUL WINNER
FIRST WEEKEND IN MARCH TO BEFORE AND DURING THE MOONLIGHT WAS CROWNED
AVOID CONFLICTING WITH THE CEREMONY
CLOSING CEREMONY OF THE ESPECIALLY SINCE VOCAL METOO THIS YEAR AWARDS WATCHERS ARE
WINTER OLYMPICS THANKS SUPPORTERS LIKE ASHLEY JUDD UNEQUALLY DIVIDED BETWEEN
PYEONGCHANG LAURA DERN AND THREE BILLBOARDS
NICOLE KIDMAN ARE SCHEDULED OUTSIDE EBBING MISSOURI THE
ONE BIG QUESTION SURROUNDING PRESENTERS FAVORITE AND THE SHAPE OF
THIS YEARS ACADEMY AWARDS IS WATER WHICH IS
HOW OR IF THE ANOTHER FEATURE OF THIS THE BAGGERS PREDICTION WITH A
CEREMONY WILL ADDRESS METOO SEASON NO ONE REALLY KNOWS FEW FORECASTING A HAIL MARY
ESPECIALLY AFTER THE GOLDEN WHO IS GOING TO WIN BEST WIN FOR GET OUT
GLOBES WHICH BECAME PICTURE ARGUABLY THIS HAPPENS
A JUBILANT COMINGOUT PARTY FOR A LOT OF THE TIME INARGUABLY BUT ALL OF THOSE FILMS HAVE
TIMES UP THE MOVEMENT THE NAILBITER HISTORICAL OSCARVOTING
SPEARHEADED BY NARRATIVE ONLY SERVES THE PATTERNS AGAINST THEM THE
POWERFUL HOLLYWOOD WOMEN AWARDS HYPE MACHINE BUT SHAPE OF WATER HAS
WHO HELPED RAISE MILLIONS OF OFTEN THE PEOPLE FORECASTING NOMINATIONS MORE THAN ANY
DOLLARS TO FIGHT SEXUAL THE RACE SOCALLED OTHER FILM AND WAS ALSO
HARASSMENT AROUND THE OSCAROLOGISTS CAN MAKE ONLY NAMED THE YEARS BEST BY THE
COUNTRY EDUCATED GUESSES PRODUCERS AND DIRECTORS
GUILDS YET IT WAS NOT
SIGNALING THEIR SUPPORT THE WAY THE ACADEMY TABULATES NOMINATED FOR A SCREEN
GOLDEN GLOBES ATTENDEES THE BIG WINNER DOESNT HELP IN ACTORS GUILD AWARD FOR BEST
SWATHED THEMSELVES IN BLACK EVERY OTHER ENSEMBLE AND NO FILM HAS
SPORTED LAPEL PINS AND CATEGORY THE NOMINEE WITH THE WON BEST PICTURE WITHOUT
SOUNDED OFF ABOUT SEXIST MOST VOTES WINS BUT IN THE PREVIOUSLY LANDING AT LEAST
POWER IMBALANCES FROM THE BEST PICTURE THE ACTORS NOMINATION
RED CATEGORY VOTERS ARE ASKED TO SINCE BRAVEHEART IN THIS YEAR
CARPET AND THE STAGE ON THE LIST THEIR TOP MOVIES IN THE BEST ENSEMBLE SAG ENDED
AIR E WAS CALLED OUT ABOUT PAY PREFERENTIAL ORDER IF A UP GOING TO
INEQUITY AFTER MOVIE GETS MORE THAN PERCENT THREE BILLBOARDS WHICH IS
ITS FORMER ANCHOR CATT SADLER OF THE FIRSTPLACE VOTES IT WINS SIGNIFICANT BECAUSE ACTORS
QUIT ONCE SHE LEARNED THAT WHEN NO MAKE UP THE ACADEMYS
SHE WAS MAKING FAR MOVIE MANAGES THAT THE ONE LARGEST BRANCH THAT FILM
LESS THAN A MALE COHOST AND WITH THE FEWEST FIRSTPLACE WHILE DIVISIVE ALSO WON THE
DURING THE CEREMONY NATALIE VOTES IS ELIMINATED AND BEST DRAMA GOLDEN GLOBE
PORTMAN TOOK A BLUNT ITS VOTES ARE REDISTRIBUTED TO AND THE BAFTA BUT ITS
AND SATISFYING DIG AT THE THE MOVIES THAT GARNERED THE FILMMAKER MARTIN MCDONAGH
ALLMALE ROSTER OF NOMINATED ELIMINATED BALLOTS WAS NOT NOMINATED FOR BEST
DIRECTORS HOW COULD SECONDPLACE VOTES AND THIS DIRECTOR AND APART FROM ARGO
THAT BE TOPPED CONTINUES UNTIL A WINNER MOVIES THAT LAND BEST PICTURE
EMERGES WITHOUT ALSO
AS IT TURNS OUT AT LEAST IN EARNING BEST DIRECTOR
TERMS OF THE OSCARS IT IT IS ALL TERRIBLY CONFUSING BUT NOMINATIONS ARE FEW AND FAR
PROBABLY WONT BE APPARENTLY THE CONSENSUS BETWEEN
FAVORITE COMES OUT
WOMEN INVOLVED IN TIMES UP AHEAD IN THE END THIS MEANS
SAID THAT ALTHOUGH THE GLOBES THAT ENDOFSEASON AWARDS
SIGNIFIED THE CHATTER INVARIABLY
Task 2: Encryption using Different
Ciphers and Modes
Random plain text was used
i. -aes-128-cbc
- Using -k flag to set password instead of direct keys, and -p flag to
visualize/see the key, iv4, salt generated for better understanding
for this assignment purposes.

ii. using blowfish


-Using ‘-K’ ‘iv’ flags instead of English passphrase and gave the
key manually to the algorithm, which is why it did not need salt
since direct key was given so it didn’t feel the need to generate
salt as it did in earlier iteration.

iii. -aes-128-cfb
-Moreover, if you encrypt with ‘-P’ flag; it creates a file due to ‘-
in’ ‘-out’ flags but the file created is empty which is verified by
‘cat’ and ‘ls -l’ command for content and size respectively.
Task 3: Encryption Mode – ECB vs. CBC
-Opening the file that we installed using ‘xdg-open’ since ‘eog’
wasn’t being installed.

-Encrypting the file with ‘-k’ password and ‘ecb’, getting header
of encrypted file and merging with body to make a new
encrypted file.
-Upon opening the file, you can see the pattern of original
image is still visible; so not really much of an encryption

-After encrypting with ‘cbc’, the encrypted image does


not show any resemblance to the original image.
-Upon decrypting ‘cbc’ image we get original image as
is.

So, to conclude ‘cbc’ encryption is


better than ‘ecb’.
Task 4: Padding
ECB CBC CFB OFB
Operates Also operates Works as a Also turns
directly on 16- on fixed 16- stream cipher block cipher
byte blocks. byte blocks. (converts into a stream
block cipher cipher.
into a stream
cipher).
Needs Needs Operates byte Operates byte
padding if padding for by byte (or in by byte.
plaintext size plaintext not smaller
is not a multiple of 16. segments).
multiple of 16.

Does NOT Does NOT


need need
padding. padding.

-Creating files and verifying their sizes.


-The padding is not always added ‘00’ instead the number of
bytes remaining to reach 16 is added e.g: In ‘f2’ we had 10
bytes and 6 bytes remaining so 06 was added 6 times.
-The reason why ‘f3’ got padded with 16 bytes even after
having multiple of 16 bytes in it is because of upper reason
because if the file is multiple of 16 bytes but content is ending
at ‘06’ decryptor would be confused that if this ‘06’ is part of
content or padded value. So when padding a 16-byte file with
16 bytes it helps decryptor differentiate between content and
padded.
Task 5: Error Propagation – Corrupted
Cipher Text
Before conducting tests, observations:

ECB CBC CFB OFB


1 full block 1 full block 2 full blocks Only the
(16 bytes) corrupted corrupted corresponding
corrupted (the (block with (block with byte(s)/bit(s)
block where byte 55) + 1 byte 55 and in the
byte 55 is). bit flipped in the following affected block
Everything the next block). Rest are corrupted
else block. Rest recoverable. (a single-bit
recoverable. recoverable. flip in P3).
Rest
recoverable.
[Link]
-targeting 55th byte i.e. 60 changed to 32.

As expected only one byte got affected.


[Link]
[Link]
[Link]

Just one place was affected, rest was


recoverable.
Task 6: Initial Vector (IV) and
Common Mistakes
6.1
Different iv4 with same key

Same iv4 with same key


By using same iv4 with same key, we introduce risk of
having same encryption; hence should use diff iv4 if
using same key for randomness.
6.2
1. Using the same IV in OFB leaks the entire P2.
2. In CFB mode, only the first block of P2 can be
revealed.
6.3
Connection refused to NC hence could not do it.
Task 7: Programming using the Crypto
Library
Key is Syracuse

Common questions

Powered by AI

Selecting a cipher mode involves considering error propagation, pattern visibility, and the need for padding. CBC is preferable over ECB for its ability to conceal patterns and its lesser vulnerability to single-byte errors. However, CBC involves more complexity in operation and requires padding if data isn't a multiple of 16 bytes, unlike stream cipher modes like CFB and OFB, which do not require padding .

Moving the Oscar ceremony to the first weekend in March aims to avoid overlapping with the Winter Olympics closing ceremony, which can ensure maximum viewership and media coverage. This strategic decision reflects the importance of timing in ensuring the ceremony's prominence and reducing competition for audience attention with other major events .

The Time's Up movement aimed to extend beyond the awards season by working behind closed doors to create sustained legal and social change. Although the Golden Globes served as a high-profile platform for launch, the movement's focus quickly shifted towards developing a legal defense fund and garnering grassroots support, signaling their intention to affect longer-term societal impact rather than just surface-level visibility .

Donations, particularly small contributions from a broad donor base, significantly bolster the legal defense fund for the Time's Up initiative. This influx of funds empowers the movement to sustain legal challenges and support victims of harassment, demonstrating widespread public support and enhancing the campaign's capacity to enact change .

CFB mode converts a block cipher into a stream cipher by operating on smaller segments of the data rather than fixed blocks. It generates keystream blocks that are then XORed with the plaintext segments, allowing it to encrypt data in a stream-like fashion and not requiring padding because it encrypts byte-by-byte .

The Academy uses a preferential voting system for Best Picture, which requires voters to rank movies in order of preference. If no film receives more than 50% of first-place votes, the one with the fewest votes is eliminated, and its votes are redistributed. This process continues until a winner emerges. The significance lies in its complexity and potential to alter outcomes, where second or third-choice preferences can influence the final decision more significantly than immediate favorites .

In ECB mode, when a full block (16 bytes) is corrupted, only that block is affected, and the rest is recoverable. For OFB mode, only the corresponding byte(s)/bit(s) in the affected block are corrupted, while the rest remain recoverable. This shows that OFB has better resilience to single-byte errors compared to ECB .

Using the same IV with the same key introduces the risk of producing identical encryptions, thereby compromising the randomness and security of the encryption process. It is recommended to use different IVs with the same key to maintain data security .

The experiments demonstrate that using ECB mode for encrypting images still shows visible patterns of the original image. In contrast, encrypting with CBC mode results in an encrypted image that does not resemble the original image at all. This indicates that CBC offers better encryption effectiveness as it obscures patterns more effectively than ECB .

Padding ensures that the decryptor can distinguish between content and padding. For a file with content ending at '06', padding it with additional 16 bytes helps avoid confusion during decryption, thus ensuring accuracy in retrieving the original content .

You might also like