Cryptographic functions which transform plaintext into ciphertext or the other way around.

learn more… | top users | synonyms

13
votes
9answers
1k views

Why not the one-time pad with pseudo-number generator

I am very new to cryptography (so be kind), but I have a question that may seem silly. If the one-time pad is the perfect cipher and impossible to crack, why would the following algorithm not be one ...
11
votes
4answers
591 views

Could one construct a cipher that is secure for friendly parties to use but insecure for hostile parties?

Consider the situation of a nation state (Blue) at war with another nation state (Red). Blue wants to deploy a secure cipher that blue currently can not break, but they are considered that Red could ...
9
votes
2answers
437 views

Can AES decryption be used as encryption?

Definition E: AES encryption D: AES decryption x: plain text y: encrypted text k: key In original AES cipher, encryption: y = E(x, k) decryption: x = D(y, k) Then I define the "reverse AES ...
8
votes
2answers
2k views

What's is the main difference between a key, an IV and a nonce?

What are the main differences between a nonce, a key and an IV. Without any doubt the key should be kept secret. But what about the nonce and the IV. What's the main difference between them and their ...
8
votes
1answer
762 views

How can I make my cipher show the avalanche effect?

I am a beginner in cryptography. I designed an password based encryption-decryption algorithm, which uses a random salt and a password to encrypt a message. I'm using SHA-512 for hashing, matrix ...
5
votes
3answers
781 views

Relative security of a Vigenère cipher

Within a closed computer network, I am ciphering some plaintext data as an added security measure. This is below several other layers of protection. For various technical reasons, I am restricted to ...
5
votes
3answers
175 views

AES column mixing and S-Box confusion

I am trying to understand the AES encryption algorithm. I know that we process 128 bits at a time for a 128 bit key in a 4x4 octet form, but am confused by the following: How does the substitution ...
5
votes
2answers
484 views

What is the security loss from reducing Rijndael to 128 bits block size from 256 bits?

As you know in the past few weeks it has emerged that NIST/NSA have been involved in weakening encryption standards over a long period of time so that they can retain the ability to break encryption ...
5
votes
1answer
336 views

What is the best method to determine the language used in a monoalphabetic substitution cipher?

Working on a cipher (which I assume to be a mono-alphabetic substitution cipher due to the letter frequency) I struggle with the fact that I don't know which language the plain text is written in. ...
4
votes
3answers
945 views

A simple block cipher based on the SHA-256 hash function [duplicate]

I've come up with this little routine for doing encryption using the SHA-2 (in this case SHA-256) hash function. As such it is a block cipher with a 256 bit (32 byte) block size and an arbitrary key ...
4
votes
2answers
742 views

Difference between symmetric and asymmetric hash function?

The Linux kernel supports symmetric and asymmetric hash functions. E.g. sha1, sha256, ... See tcrypt.c and search for test_hash_speed and ...
4
votes
1answer
630 views

The exact difference between a permutation and a substitution

I've noticed confusing definitions about permutation and substitution, preventing to make the difference. A permutation changes the order of distincts elements of a set, but this can be writen as a ...
4
votes
1answer
95 views

Question about the definition of a perfect cipher

I need to prove that the following encryption scheme is a perfect cipher: Let $p$ be a prime. The secret key is a pair $(a,b)$ sampled uniformly at random from $\mathbb{Z}_p^* \times \mathbb{Z}_p$. ...
4
votes
0answers
137 views

Reordering non-block-aligned parts with DES in ECB mode

I was given a ciphertext file which was encrypted using DES in ECB mode. It is known that the plainttext that was encrypted has the following form: Each line of text consists of a payroll followed ...
3
votes
2answers
2k views

How many keys does the Playfair Cipher have?

I was just studying the Playfair cipher and from what I've understood, it is just a slightly better version of a Caesar cipher, in that it isn't actually mono-alphabetic but rather the 'digrams' are ...
3
votes
2answers
420 views

Is this hand cipher any more secure than the Vigenère cipher?

I know that inventing one's one crypto always sucks, but the problem is that hand ciphers are usually very insecure very slow. This is an attempt to make a relatively secure, keyable, and ...
3
votes
1answer
169 views

When confusion is applied during encryption?

I know confusion is used in cryptography to make it more difficult to identify any relationship between the ciphertext and the symmetric key. I want to know when the confusion is applied during ...
3
votes
1answer
784 views

How do I decrypt ciphertext with this cipher?

I have an encryption function $$E(p) = (ap + b) \mod{26}$$ where the parameters are $a=7$, $b = 10$, and $p$ is the plaintext letter. I was asked to decrypt the ciphertext ...
2
votes
2answers
389 views

Could the Enigma algorithm be classified as a Feistel network?

The Enigma algorithm is a encryption method that was developed (I believe) by the Germans in WWII. It went a little something like this: When a letter was typed on the keyboard of the Enigma ...
2
votes
4answers
132 views

Which encryption method supports random reads?

I have a file containing 16-bit samples and I want to encrypt it, but the problem is that I need to be able to read any random 16-bit value from the file, and be to able to decrypt it, without reading ...
2
votes
1answer
132 views

Camellia cipher - is it a symmetric or asymmetric cipher?

I read a wiki page about Camellia cipher and know that it is a block cipher that can use 128-bit, 192-bit or 256-bit keys. But I cant find any information about if its a symmetric cipher (uses one key ...
2
votes
3answers
271 views

Some cryptography security questions

I recently had a discussion with a friend of mine about cryptography. As we are both no experts, I thought that I could better resolve are dispute here :-). My friend said that when he used public ...
2
votes
1answer
132 views

Security considerations on “expand 32-byte k”-magic number in the Salsa20 famility of stream ciphers?

I'm currently examining the NaCl library written by Daniel J. Bernstein and I noticed that the library hard codes the sigma: ...
2
votes
2answers
131 views

How to compare two datasets „anonymously”?

Ok, I hope this question makes some sense because I am not so sure how to word it any differently… Imagine the following situation: There are 10 defined colors (blue, orange, yellow etc.) There are ...
2
votes
1answer
238 views

Symmetric encryption mode where ciphertext size is plain text size

I've had many questions on Stackoverflow on how to minimize the output of a cipher - during encryption of course - to the same size as the input. Obviously this is possible for a single block of ...
2
votes
2answers
186 views

plaintext and its encrypted version known [duplicate]

I have a (long) text in two versions, encrypted and plaintext. I think it was encrypted using a substitution cipher method (I'm pretty sure, indeed). I'm not good in this matter, I know little about ...
2
votes
2answers
198 views

How can A pass a message to B, while preventing a third party from sniffing infos?

$A$ has a message that he wants to send to $B$, without a third party being able to learn the contents of the original message. $A$ encrypts the message and sends it to a server. The server decrypts ...
1
vote
3answers
328 views

Do any non-US ciphers exist?

Plenty of ciphers come out of the USA from government research or selection competitions. AES and DES are examples. Are there any public ciphers produced by other states, China or Iran for example? ...
1
vote
1answer
199 views

How do I calculate the maximum plain text length allowable for a certain cipher text length?

I am encrypting and storing sensitive values in the database. I have a set max length in the database, but in order to provide useful user feedback, I'd like to know the max input I should allow for a ...
1
vote
3answers
199 views

Looking for cipher that uses one ciphertext

I'm new to Cryptography so please free to edit my question for clarity and add the appropriate tag. I'm trying to research if the following is possible. Suppose John has a message that he ...
1
vote
1answer
140 views

Diffie-Hellman: Does the size of the prime modulus depend on the potential size of the secret?

I'm writing my own cryptosystem that uses One Time Pad and Diffie-Hellman to generate keys for the OTP. I am using Rails on the server side and Javascript for the client side. Please don't tell me ...
1
vote
2answers
192 views

Can I construct a feasible stream cipher out of HMAC and a secure hash algorithm?

I have constructed a stream cipher from a secure hash algorithm and a HMAC. Here is a brief description of the algorithm: Let: (Actually Objective-C styled pseudo code) ...
1
vote
2answers
270 views

Are there any hand ciphers not obsoleted by computer cryptanalysis? [duplicate]

Computerized cryptanalysis has obviously made formerly "secure" hand ciphers like Playfair, Four Square, and the Hill Cipher obsolete because they can be defeated in seconds. But is there a hand ...
1
vote
1answer
78 views

Incorporating known ciphertext into new message

Which ciphers $c_k$ enable one to define a joining function $f_{c,k}$ such that: $$ f_{c,k}(c_k(p_1), p_2) = c_k(p_1 + p_2) $$ That is, the result of joining some known ciphertext $c_k(p_1)$ with a ...
1
vote
1answer
51 views

Using cryptographic hash to match AES key size

I am making a tool for myself where I intend to store cipher text. I wish to use AES together with arbitrary sized keys to create these cipher text strings. The idea is to use a cryptographic hash ...
1
vote
1answer
257 views

Which encodings have |encoding key| >> |decoding key|?

I'm looking for an encoding scheme that requires a very large encoding key E (>10MB) and suffices with a relatively small decoding key ...
1
vote
0answers
67 views

How we transfer 128bits cipher to a 4x4 matrix for AES input?

Why the input cipher for AES encryption, can write in 4x4 matrix with 8 bits entires, and can said is 128bits? if each cell is 8bits in binary, how we said this matrix is represent 128bits?
1
vote
0answers
28 views

Index of coincidence for completely random text over k alphabets

I'm confused about /Friedman's method 2 (using a table with column of k size of key, and n/k rows, n is the total size for cipher text) \begin{equation} m = ...
0
votes
1answer
104 views

Significance of repetition in XOR cipher text

I'm attempting to recover plain-text (P1, P2) from two uneven cipher-text strings (C1, C2) that I suspect used the same key (K). When I XOR C1 and C2 together to obtain (P1+P2), there is repetition ...
0
votes
1answer
189 views

How to plot the distribution of a ciphertext?

Is there any plot or visualizing program that can plot the distribution of a plaintext and then the distribution of the ciphertext after applying a ciphering encryption algorithm? I am interested ...
0
votes
1answer
320 views

Why does my implementation of CBC mode only decrypt the first block correctly? [closed]

I have the following code that uses a CBC mode to encrypt a text by dividing it to 3-elements block. But it only works correctly on the first block which is xored with the IV. ...
0
votes
0answers
244 views

Question on mono-alphabetic substitution cipher and poly-alphabetic substitution cipher

You know that a meaningful plaintext in a language with a 26-letter alphabet, like English, is encrypted using either the mono-alphabetic substitution cipher or the poly-alphabetic substitution cipher ...
0
votes
0answers
57 views

Decryption returns different data

I am new to cryptography so forgive me if I am doing anything stupid. I am following the Cryptography in JAVA book. I am creating my own kerberos. I am stuck at a point. I have Message class which ...
0
votes
1answer
59 views

Substitution Cipher Help [closed]

I have the following ciphertext: w jaoot zhoipqjwp ql wee lro oawxaop I know it is a substitution cipher but using my frequency analysis skills does not help me to find the plaintext. I think the ...
0
votes
1answer
170 views

XOR cipher Pseudo-random key strength

When implementing a XOR cipher with a pseudo-random key equal in length to the plaintext, Is there a significant difference in potential key strength between keys drawn from a pool of either 1000 or ...
-1
votes
1answer
167 views

How to bring little changes in DES algorithm

I thought of implementing DES modes of operation as a project...But my guide asked to change or to modify the DES algorithm in such a way to overcome drawbacks of DES...So is there any way to do ...
-1
votes
1answer
164 views

SHA256-based stream cipher

Can anyone comment if the stream cipher described here is safe? The author claims it to be unbreakable, but does not provide any evidence or proof to support this. For completeness, I have reproduced ...
-1
votes
1answer
89 views

Hash Based Encryption (fast & simple), how well would this compare to AES? [duplicate]

First of all, I know it's a very bad idea to invent your own encryption algorithm. It's better to use existing known, trusted, extensively tested and studied algorithms with a proven track record. The ...
-2
votes
1answer
186 views

What is the most paranoid way to exchange messages? [closed]

I'm looking for a way for Alice to send a message or a file to Bob in the most paranoid way possible (over the internet). It can be asymmetric or symmetric. But According to some articles, AES ...