Questions tagged [stream-cipher]

A cryptostream is a stream that implements a stream cipher, which is a symmetric encryption algorithm that encrypts arbitrary length input stream of plain text, using a cipher stream (key) to produce an output stream of ciphertext.

What is it?

A cryptostream is a stream that implements a stream cipher.

A stream cipher is a symmetric encryption algorithm which encrypts arbitrary length stream of plain text, using a cipher stream (key) to produce a stream of ciphertext.

How does it work?

Symmetric encryption algorithm are subdivided in block ciphers and stream ciphers. Block ciphers encrypt fixed blocks of plaintext bits. Stream ciphers encrypt each plain text digit one by one.

So a stream cipher converts a stream of plaintext into a stream of ciphertext in real-time.

The .net framework offers a CryptoStream class that implements a stream cipher.

See also

36 questions
0
votes
0 answers

What to expect and how to use OpenSSL 1-bit stream cipher modes

I am trying to use the 1-bit stream cipher mode in OpenSSL, specifically EVP_aes_128_cfb1. I initialize the context with that parameter using, EVP_EncryptInit_ex(). The rest is unclear to me. I am expecting this to work as a bit-by-bit stream…
ariy
  • 11
  • 1
0
votes
1 answer

Why stream cipher produces different ciphertext evertime it is invoked on the same plaintext?

I read this statement on the book: "Applied Cryptography": With a blocker cipher, the same plaintext block will always encrypt to the same ciphertext block, using the same key. With a stream cipher, the same plaintext bit or byte will encrypt to a…
wangshuaijie
  • 1,821
  • 3
  • 21
  • 37
0
votes
2 answers

How to generate a pseudo-random number using a seed in java for a Stream Cipher?

I am working on a Stream Cipher program in Java which should take three arguments from the shell: a file with a key, a file for input, and a file for output. The key should then serve as the seed which should generate a pseudo-random number which…
0
votes
1 answer

RC4 Encryption Function

I am trying to create a R function that will take a seed,and key length to generate a RC4 keystream. The following is what I have so far: library(numbers) library(seqinr) library(compositions) rc4_genkey <- function(seed,keylength){ …
Zaid Islam
  • 29
  • 3
0
votes
1 answer

Decryption only yields one correct line after encrypting line by line using RC4 algorithm

I have to encrypt a file line by line using the RC4 algorithm. Encrypting the whole file and decrypting the whole file yields the original which is fine. When I attempt to read the file one line at a time,encrypt it and then write the encrypted…
Nikaselo
  • 23
  • 6
0
votes
0 answers

Grain-128 Cipher sample input and output

I downloaded grain 128 program code from the ecrypt website http://www.ecrypt.eu.org/stream/grainp3.html for carrying out my research on grain-128. I couldn't setup the estream software setup framework and run original grain 128.So I modified the…
0
votes
2 answers

How to use stream cipher to encrypt TCP data?

i try to use chacha20 encryption in my network software but i encounter a problem if i encrypt 4 bytes data: 0x01 0x02 0x03 0x04 on server and get the ciphertext: 0xd2 0xd3 0xc4 0xd5, then send it to client the client may receive <= 4bytes at a…
0
votes
2 answers

In stream cipher, how can an attacker get m1 m2 if he knows (m1 xor m2)?

We know that in stream cipher c = m xor G(k). And if the key was used more than once, the attacker can get c1 = m1 xor G(k) c2 = m2 xor G(k) Then he knows c1 xor c2 = m1 xor G(k) xor m2 xor G(k) = m1 xor m2. So with the knowledge of (m1 xor m2),…
YourTeddy
  • 413
  • 2
  • 5
  • 8
0
votes
1 answer

Difference between secure PRG and and semantically secure

I am taking cryptography course in coursera by Stanford University. and I have following question. I have a question why append 0 in G(k) i.e., G'(k) = G(k) || 0 is considered as not secure PRG as 0 in message is copied with out encryption.…
venkysmarty
  • 11,099
  • 25
  • 101
  • 184
0
votes
1 answer

How to use salsa20 which is on git

I want to use Salsa20 as a part of my assignment. The implementation is available at everard/Salsa20 GitHub. The problem is I am new to git and programming. The document says add Salsa20.h and Salsa20.inl, so does this mean that I have to add these…
0
votes
1 answer

Implementation of A5/1 algorithm in java is not giving any output

Following code is not giving any decrypted output Sample: Enter the string to be encrypted: hello …
Dhaval
  • 31
  • 8
0
votes
1 answer

Stream cipher using java

I'm trying to create a Stream cipher using Java in which I take plain text from the file encrypt it (Simple XOR with a random key with seed value) and the store it in a different file and then to decrypt, again take cipher text from the file and…
0
votes
1 answer

Java Stream Cipher (With input and output txt files) outputting random characters not complete decrypted string

Don't know where I went wrong necessarily but my program is supposed to be a stream cipher that takes an input.txt file of chars and encrypts it into numbers and then decrypts it back to chars. My issue is that I type in: java Program4 -e 71 <…
Ben Fogler
  • 35
  • 4
0
votes
1 answer

GSM A5 Encryption Reinitialized each frame?

In the A5 algorithms, after generating 114 bits each for down and upstream, does the pseudo random number generator get set to 0000 at the end of each frame? So it is reinitialized at the next frame with 64-Bit-Kc, 22-Bit-Frame-COUNT and then the…
Phil
  • 7,065
  • 8
  • 49
  • 91
0
votes
1 answer

Block or Stream Encryption?

I want to know if data stored in encrypted form is encrypted by block-cipher or a stream-cipher? I have encrypted data, how do I check that it comes from a block or a stream cipher?
bhartay
  • 1
  • 2