ginaspider (ginaspider) wrote in algorithms,

keystream

Dear lazy web,

Do you know if there exists any keystream algorithms where in which, given an input key, you can request from the algorithm something like "give me slot 433"?

Let me clarify,
so a typical keystream you seed with some key and then are able to request sequential bytes. In my particular application I want to encrypt 8Kbytes xored against a keystream but have it so it can be randomly read and written to. So I guess it would be like a key-block cipher or something like that. I don't fancy re-implementing crypto so I'm wondering if such a technique exists out there.
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 5 comments

chouyu_31

May 7 2010, 18:05:01 UTC 4 years ago

See the "counter mode" here: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation .

ginaspider

May 7 2010, 18:47:39 UTC 4 years ago

hmm... ok thanks mate. I suppose of all else fails I can encrypt against a xor of the ciphertext from a block cipher.

chouyu_31

May 7 2010, 21:29:45 UTC 4 years ago

Think of your data as a set of blocks of some fixed size (4, 8, or 16 bytes is typical). If you want to decrypt a single byte, fetch the right block, decrypt the block, and return just the byte you want to decrypt.

While the typical mode of operation for ciphers is via sequential stream (especially with feedback modes of operation), the counter mode offers random access for free.

ginaspider

May 7 2010, 22:04:47 UTC 4 years ago

Hmm... ok, thanks

justjim22

July 4 2010, 04:52:35 UTC 4 years ago

I know very little about this as far as detailed solutions, but can you insert a node or something and call it what you want?