# Security of expanded key

Can somebody analyze this scheme and explain how (in?)secure it is?

Assume that:

• The keys were initially securely exchanged
• All keys are truly random

In this scheme:

• The key size is of length 2s, the plaintext is of length s, and the total message size is 3s
• The first 2s contains a randomly-generated key to be used for the next message
• The last s contains the plaintext.
• The message in question uses the Vernam cipher
• The first half of the key encrypts the next key, and the last half encrypts the plaintext

How secure is it to have every bit in the first half of the key (total size s) encrypt every two bits of the next key to be used?

• Does this leak information about the keys?
• Is it possible to actually deduce keys from that?

What if some sort of random mapping where each bit of the key does not encrypt consecutive bits of the next key was thrown into the mix?

Edit:

Example message layout:

| Next Key(size 2s) | Plaintext(size s) | | |^ This half is the key for the next plaintext ^ This half is used to encrypt the whole key (each bit encrypts 2 bits of the next key) 

Edit 2:

Message: | Next Key Key | Next Key | Plaintext | ^Encrypts this-\/ ^Encrypts this-\/ Possible Random Mapping->\/ \/ [_________________________] \/ Next message: | Next Key Key | Next Key | Plaintext | 

What is inherently insecure about each bit of a random key encrypting two bits of the next (entirely random) key in this scenario?

In addition, would adding a random mapping between the bits of Next Key Key and the next key add any security if the mapping was changed every message (some kind of mapping struct in the plaintext)?

If not, why? If this scheme is completely insecure, I wish to understand in what specific ways it may (as you say) leak information about the plaintext.

Edit 3:

Upon inspection, it turns out that one only needs to figure out HALF of the first key in order to crack the entire message chain. Each message makes it easier to find that half-key, since each message depends on the previous one.