Questions tagged [cryptanalysis]

study of analyzing cryptographic systems in order to get information of the key or the message by finding weaknesses in the cryptographic algorithm.

The question on this tag should be related to one of the following subjects: Cryptanalysis methods, Cryptanalysis implementations. It should not contain question about: side channel attacks.

The quality of an attack is measured by 3 parameters:

  • Time: The amount of encryptions taken to attack. It can be splitted to time before attacking and online time.

  • Memory: Size of the needed memory.

  • Data: Amount of data needed to perform the attack. This can be known plaintext, chosen plaintexts, known ciphertext, etc.

44 questions
1
vote
4 answers

How to add mathematical function as argument in python function

I know there are similar questions about passing functions into functions, but I'm not clear on the effective solution for my particular problem. The following function works but the formula is static. It only works on a fixed function, namely (in…
gcr
  • 443
  • 2
  • 5
  • 14
1
vote
0 answers

How to decrypt a .txt.gz.enc file with a python program without knowing the key?

For this problem I have been given an encrypted text file and have been asked to find the key and then decrypt the file into a .txt.gz file. So far, I know that the cipher I should be using is a type of substitution cipher. I was given the code that…
anon
  • 23
  • 5
1
vote
2 answers

SHA256 Find Partial Collision

I have two message: messageA: "Frank is one of the "best" students topicId{} " messageB: "Frank is one of the "top" students topicId{} " I need to find SHA256 partially collision of these two messages(8 digits). Therefore, The first 8 digests of…
FRANKfisher
  • 121
  • 3
  • 12
1
vote
1 answer

Cipher Cryptanalysis Implementantion

Given then plain text, the encrypted text and the keyword length I am called to find the cipher key using brute force attack. What I did was to take the six first characters from plain text and encrypted text and through the letter distances to…
athpap
  • 21
  • 1
1
vote
2 answers

Which algorithms most reliably solve substitution ciphers?

I am studying a problem which reduces to the cryptanalysis of a lengthy monoalphabetic substitution ciphertext written in a known language. This problem is easy enough to be solved by hand using frequency analysis and word patterns, as described in…
1
vote
3 answers

Trying to decrypt a PHP PseudoCrypt class

I am trying to create a way to reverse the PseudoCrypt script listed at: http://blog.kevburnsjr.com/php-unique-hash. In this code it has the following equation: $dec = ($num * $prime)-floor($num * $prime/$ceil)*$ceil; I have been able to get every…
DanielJay
  • 292
  • 3
  • 13
1
vote
2 answers

Do not understand the error I am receiving?

I have this function that I have significantly simplified that calculates the multiplicative and additive keys for decrypting an affine cipher and it works in some cases but there is this one case where it is throwing me an error and I am unsure…
user11138547
1
vote
1 answer

My cryptanalyis of an affine cipher isn't working 100% of the time

I have to create a function that takes input as letters from a frequency analysis of the English language, "p1" and "p2", as well as a frequency analysis of the cipher-text, "C1" and "C2", as well as the alphabet length I am using "AL". I have…
user11138547
1
vote
3 answers

repetition in encrypted data -- red flag?

I have some base-64 encoded encrypted data and noticed a fair amount of repetition. In a (approx) 200-character-long string, a certain base-64 character is repeated up to 7 times in several separate repeated runs. Is this a red flag that there is a…
JoelFan
  • 37,465
  • 35
  • 132
  • 205
1
vote
2 answers

How to implement modular exponentiation?

I am trying to calculate something like this: a^b mod c, where all three numbers are large. Things I've tried: Python's pow() function is taking hours and has yet to produce a result. (if someone could tell me how it's implemented that would be…
1
vote
1 answer

Loop in an algorithm which is dependent on hex value

I am only learning c and I am trying to implement a for loop from an algorithm. I am so so confused in how to implement it, please see my attempt below. Any help or thoughts would be greatly appreciated, it implies a loop within a loop which has a…
Jimbo Jones
  • 983
  • 4
  • 13
  • 48
1
vote
1 answer

Generate permutation with keyword

I have to implement the following algorithm which will be run a few zillion times in the cryptanalysis of a specific cipher, by hill-climbing. The algorithm produces a permutation of the standard alphabet {A,B,C,...,Y,Z} with a key K of 7 letters of…
user863967
  • 11
  • 2
1
vote
1 answer

Create permutations of char arrays based on letter frequencies in Java

I've got a HashMap which stores the frequencies of each letter in a block of ciphertext, in the form of Character, Integer. The map is then sorted into a LinkedHashMap by most frequent descending. I then compare these frequencies to a known list of…
Josh Roberts
  • 862
  • 6
  • 12
1
vote
1 answer

What is velocity in particle swarm optimisation for cryptanalysis?

I'm trying to implement a particle swarm optimization algorithm for a cryptanalysis local search to find the key of a simple substitution cipher. I understand the theory of how this method work and have implemented most of the algorithm, but I just…
Josh Roberts
  • 862
  • 6
  • 12
1
vote
1 answer

Is (number of picoseconds of CPU time used by the current program + clock time), a seed immune to cryptanalysis for a pseudo random number generator?

I am trying to use this ECDSA implementation in Haskell, if you look at line 15, you will see that the k value uses randomRIO which uses the global random number generator the getter of which uses the theStdGen which uses mkStdRNG which makes the…