0
$\begingroup$

I have recently been playing around with cyphers and creating some simple ones to practice and improve my programming skills, and I recently created a cipher which in my opinion is very complex and secure, even utilising binary, and then I started to wonder whether or not my cipher could actually be used, so after doing a little bit of research I found out that, apparently, a cipher isnt good unless its the same length as the original? so if you input "password" my cypher outputs "[.##4959#12#41#8#{20", a very complex algorithm is used here, and my idea was that this cipher would be used with short pieces of text/numbers, like passwords or bank account numbers. so is my cypher useless?

$\endgroup$
  • 1
    $\begingroup$ Hussam, you appear to have created 2 accounts. See here for how to merge them. $\endgroup$ – mikeazo Dec 4 '17 at 20:09
1
$\begingroup$

a cipher isnt good unless its the same length as the original?

This is completely false. In fact, with most modern block cipher modes of operation, you will get ciphertext lengths that are longer than the original input. In fact, a ciphertext length longer than the input is a requirement for integrity protections (which is a must-have these days).

so is my cypher useless?

This we cannot judge given the information you've posted. Ciphertext to plaintext length ratio is meaningless when it comes to determining the utility of a cipher. If you want to know if your cipher is useful, you need to 1) publish the full details of the algorithm, 2) describe its benefits when compared to existing ciphers (what new capabilities does your cipher give me that I don't already have with AES), 3) get a bunch of really smart cryptographers to work on breaking it for years.

| improve this answer | |
$\endgroup$
0
$\begingroup$

In all generality, a cypher text cannot be systematically shorter than the clear text, because the cypher text needs to contain the same information: you need to decrypt it. It can of course be longer. Most real-world cyphers are based upon block cypher building blocks, which output exactly the same amount of text as they get in their input, but the "packaging" of the building blocks into a genuine working encryption algorithm - the "protocol" - usually adds some stuff (like padding and so on).

In some cases, the cypher text could be shorter (but not in all generality), if one uses a compression function and the input text contains much redundancy. But taken over all possible input texts, the output text is on average at least as long as the input.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.