Skip to content

Conversation

@Cizzle
Copy link
Member

@Cizzle Cizzle commented Oct 20, 2016

Found by: Cizzle
Patch by: Cizzle
Fixes: ECB mode

One-line summary: makes the default encryption module, blowfish, use CBC mode by default instead of the more insecure ECB mode.

Additional description (if needed): When using "encrypt" or "decrypt", the key can have the "ecb:" or "cbc:" prefix to explicitly set a mode to use. When encrypting, CBC mode is used by default unless the key has "ecb:" (case insensitive). When decrypting however, CBC mode is only used by default if the given string starts with "*", even when the key has "cbc:" prefixed.

@Cizzle
Copy link
Member Author

Cizzle commented Oct 20, 2016

I wasn't sure where to document the ECB / CBC key usage; in doc/tcl-commands.doc (and it's derivatives) or doc/settings/mod.blowfish; so I didn't add this to this PR.

@vanosg
Copy link
Member

vanosg commented Oct 21, 2016

Hi Cizzle, thanks for another PR! If you're ever bored, come say hi in #eggdrop on Freenode sometime. We're currently feature-frozen for 1.8.0, but we'll evaluate this for 1.8.1 as soon as we go stable on the current RC (we're soooo close, I promise!). So, please don't take inactivity on this PR as lack of interest, we'll get to it shortly!

.... and I can't wait for you to submit an AES module to replace this altogether :) Thanks again!

@Cizzle
Copy link
Member Author

Cizzle commented Oct 21, 2016

Well, ECB mode could be considered a security flaw which is fixed by CBC mode? :)

As for AES, this already exists? ftp://ftp.eggheads.org/pub/eggdrop/modules/1.8/rijndael1.0-pseudo.tar.gz
Though I haven't tested it, I already see the use of "ncrypt" in rijndael.c while "encrypt" is still used in rijndael_cipher.c.

@Cizzle Cizzle force-pushed the feat_blowfish_cbc branch from 4753e4a to 6c29b18 Compare December 1, 2016 20:14
@Cizzle Cizzle force-pushed the feat_blowfish_cbc branch 2 times, most recently from e5641fc to da2c942 Compare December 12, 2016 13:38
@Cizzle Cizzle force-pushed the feat_blowfish_cbc branch from da2c942 to d9a0618 Compare January 23, 2017 18:34
@thommey thommey added this to the v1.8.2 milestone Mar 30, 2017
@Cizzle Cizzle force-pushed the feat_blowfish_cbc branch from d9a0618 to 974b11c Compare April 16, 2017 21:40
return 0;
}

static int cbcbase64dec(char c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting

 static int cbcbase64dec(char c)
 {
  char *i = strchr(cbcbase64, c);
  return i ? (int)(i - cbcbase64) : 0;
 }

instead.

@thommey thommey merged commit 59813bc into eggheads:develop Apr 19, 2017
vanosg pushed a commit that referenced this pull request May 31, 2017
* Add global var to set blowfish mode. Automate decrypting a bit more.
* Add help for the new setting.

Update to 59813bc / #281. The order used for encrypting is now: keyprefix > global setting > default. If global setting is not set, the default is used, which is ECB until v1.9.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants