Skip to main content
Tweeted twitter.com/#!/StackCrypto/status/389591809678385152
deleted 122 characters in body; edited tags; edited title
Source Link

altering a encrypted file (DES Reordering non-block-aligned parts with DES in ECB mode)

I was given a ciphertext file which was encrypted using DES in ECB mode with the -nosalt flag. It is known that the plainttext that was encrypted has the following form:

  • Each line of text consists of a payroll followed by a name (no spaces)
  • first 32 characters for the name
  • following 8 characters for the pay amount:
    • 32 characters for the name;
    • 8 characters for the pay amount;
    • 1 newline.

An example plaintext file would be:

abcdefghikabcdefghikabcdefghikab00000000
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab11111111

and it was encrypted using this command (of course the key was not given, for obvious reasons):

openssl enc -e -des-ecb -nosalt -in plaintext.txt -out ciphertext.enc

The ciphertext file is of size 288 bytes since there are 6 '\n'newline ('\n') characters and DES encrypts in 64 bit blocks it's easy to tell that there are 7 entries in this payroll list.

The Objective: exchange the first line with the last.

If all the entries were on one line with no spaces this would be an easy task as DES in ECB mode you can move around the 64 bit blocks without being detected. All I would do is take the first 40 bytes and exchange them with the last 40 bytes. However since there is a '\n''\n' character at the end of every line this approach does not work. I feel a bit stuck. All I'm looking for is a point in the right direction.

I'm not sure if this is the best site to post this on -- if not please let me know of an alternative

Thank you for your help.

altering a encrypted file (DES in ECB mode)

I was given a ciphertext file which was encrypted using DES in ECB mode with the -nosalt flag. It is known that the plainttext that was encrypted has the following form:

  • Each line of text consists of a payroll followed by a name (no spaces)
  • first 32 characters for the name
  • following 8 characters for the pay amount

example plaintext file would be:

abcdefghikabcdefghikabcdefghikab00000000
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab11111111

and it was encrypted using this command (of course the key was not given, for obvious reasons:

openssl enc -e -des-ecb -nosalt -in plaintext.txt -out ciphertext.enc

The ciphertext file is of size 288 bytes since there are 6 '\n' characters and DES encrypts in 64 bit blocks it's easy to tell that there are 7 entries in this payroll list.

The Objective: exchange the first line with the last.

If all the entries were on one line with no spaces this would be an easy task as DES in ECB mode you can move around the 64 bit blocks without being detected. All I would do is take the first 40 bytes and exchange them with the last 40 bytes. However since there is a '\n' character at the end of every line this approach does not work. I feel a bit stuck. All I'm looking for is a point in the right direction.

I'm not sure if this is the best site to post this on -- if not please let me know of an alternative

Thank you for your help.

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 by a name (no spaces):
    • 32 characters for the name;
    • 8 characters for the pay amount;
    • 1 newline.

An example plaintext file would be:

abcdefghikabcdefghikabcdefghikab00000000
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab11111111

and it was encrypted using this command (of course the key was not given, for obvious reasons):

openssl enc -e -des-ecb -nosalt -in plaintext.txt -out ciphertext.enc

The ciphertext file is of size 288 bytes since there are 6 newline ('\n') characters and DES encrypts in 64 bit blocks it's easy to tell that there are 7 entries in this payroll list.

The Objective: exchange the first line with the last.

If all the entries were on one line with no spaces this would be an easy task as DES in ECB mode you can move around the 64 bit blocks without being detected. All I would do is take the first 40 bytes and exchange them with the last 40 bytes. However since there is a '\n' character at the end of every line this approach does not work. I feel a bit stuck. All I'm looking for is a point in the right direction.

Post Migrated Here from security.stackexchange.com (revisions)
Source Link

altering a encrypted file (DES in ECB mode)

I was given a ciphertext file which was encrypted using DES in ECB mode with the -nosalt flag. It is known that the plainttext that was encrypted has the following form:

  • Each line of text consists of a payroll followed by a name (no spaces)
  • first 32 characters for the name
  • following 8 characters for the pay amount

example plaintext file would be:

abcdefghikabcdefghikabcdefghikab00000000
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab10010010
abcdefghikabcdefghikabcdefghikab11111111

and it was encrypted using this command (of course the key was not given, for obvious reasons:

openssl enc -e -des-ecb -nosalt -in plaintext.txt -out ciphertext.enc

The ciphertext file is of size 288 bytes since there are 6 '\n' characters and DES encrypts in 64 bit blocks it's easy to tell that there are 7 entries in this payroll list.

The Objective: exchange the first line with the last.

If all the entries were on one line with no spaces this would be an easy task as DES in ECB mode you can move around the 64 bit blocks without being detected. All I would do is take the first 40 bytes and exchange them with the last 40 bytes. However since there is a '\n' character at the end of every line this approach does not work. I feel a bit stuck. All I'm looking for is a point in the right direction.

I'm not sure if this is the best site to post this on -- if not please let me know of an alternative

Thank you for your help.