Wishlist: Adding ciphers that are in other major libraries #346

Open
opened 2018-02-17 08:37:53 -06:00 by DonaldTsang · 14 comments
DonaldTsang commented 2018-02-17 08:37:53 -06:00 (Migrated from github.com)

The goal of this Issue is to "price match" libtomcrypt with other cryptographic libraries in regards to functionality and variety.

reference: https://www.cryptopp.com/

  • Block Cipher
  • IDEA
  • Kalyna
  • SIMON and SPECK
  • SM4
  • Threefish 256/512/1024
  • Serpent
  • SHACAL 1 and 2
  • TEA
  • Stream cipher
  • Salsa20 and XSalsa20
  • Panama
  • Sosemanuk

reference: https://botan.randombit.net/manual/

  • Block Cipher
  • DESX
  • GOST-28147-89
  • Lion
  • MISTY1
  • Serpent
  • SM4
  • Threefish
  • Stream Cipher
  • Salsa20
  • SHAKE128
  • Block Cipher
  • Others
  • Cipher Cascades

reference: http://www.bouncycastle.org/csharp/index.html

  • CAST6
  • DESede
  • GOST28147
  • HC-128 and HC-256
  • ISAAC
  • Serpent
  • TEA/XTEA
  • Threefish
  • Tnepres
  • VMPC
  • XSalsa20
  • GOFB mode
  • OpenPGPCFB mode

Elliptic curves that are safe
reference: https://eprint.iacr.org/2013/647

Type 224-bit 256-bit 384-bit 512-bit
Montgomery - [ ] M-221 - [ ] Curve25519 - [ ] M-383 - [ ] M-511
Edwards - [ ] E-222 - [ ] Curve1174 - [ ] E-382 - [ ] E-512
The goal of this Issue is to "price match" libtomcrypt with other cryptographic libraries in regards to functionality and variety. reference: https://www.cryptopp.com/ * Block Cipher - [x] IDEA - [ ] Kalyna - [ ] SIMON and SPECK - [ ] SM4 - [ ] Threefish 256/512/1024 - [x] Serpent - [ ] SHACAL 1 and 2 - [x] TEA * Stream cipher - [x] Salsa20 and XSalsa20 - [ ] Panama - [x] Sosemanuk reference: https://botan.randombit.net/manual/ * Block Cipher - [ ] DESX - [ ] GOST-28147-89 - [ ] Lion - [ ] MISTY1 - [x] Serpent - [ ] SM4 - [ ] Threefish * Stream Cipher - [x] Salsa20 - [x] SHAKE128 * Block Cipher - [ ] [SIV](https://botan.randombit.net/manual/cipher_modes.html#siv) * Others - [ ] Cipher Cascades reference: http://www.bouncycastle.org/csharp/index.html - [ ] CAST6 - [ ] DESede - [ ] GOST28147 - [ ] HC-128 and HC-256 - [ ] ISAAC - [x] Serpent - [ ] TEA/XTEA - [ ] Threefish - [ ] Tnepres - [ ] VMPC - [x] XSalsa20 - [ ] GOFB mode - [ ] OpenPGPCFB mode Elliptic curves that are safe reference: https://eprint.iacr.org/2013/647 |Type|224-bit|256-bit|384-bit|512-bit| |---|---|---|---|---| |Montgomery|- [ ] M-221|- [ ] Curve25519|- [ ] M-383|- [ ] M-511| |Edwards|- [ ] E-222|- [ ] Curve1174|- [ ] E-382|- [ ] E-512|
DonaldTsang commented 2018-02-17 09:08:30 -06:00 (Migrated from github.com)

I would like to note that Salsa20, XSalsa20 and ChaCha20 are all different ciphers.

I would like to note that Salsa20, XSalsa20 and ChaCha20 are all different ciphers.
sjaeckel commented 2018-02-17 10:48:09 -06:00 (Migrated from github.com)

I would like to note that Salsa20, XSalsa20 and ChaCha20 are all different ciphers.

XSalsa20 is missing but the two others are already in the latest develop branch.

Btw. do you intend to submit PR's for all these ciphers? Or is this really just a wishlist ;)

> I would like to note that Salsa20, XSalsa20 and ChaCha20 are all different ciphers. XSalsa20 is missing but the two others are already in the latest develop branch. Btw. do you intend to submit PR's for all these ciphers? Or is this really just a wishlist ;)
sjaeckel commented 2018-02-17 10:49:22 -06:00 (Migrated from github.com)

SIV can be ticked as soon as #319 is finished

SIV can be ticked as soon as #319 is finished
DonaldTsang commented 2018-02-18 08:13:11 -06:00 (Migrated from github.com)

@sjaeckel I have some basic C skills, really want to PR when I understand pointers and OO.
I might need some guidance on copy-pasting ciphers correctly to conform with coding standards.

@sjaeckel I have some basic C skills, really want to PR when I understand pointers and OO. I might need some guidance on copy-pasting ciphers correctly to conform with coding standards.
karel-m commented 2018-02-25 13:37:19 -06:00 (Migrated from github.com)

@DonaldTsang I think we should aim at features available in modern crypto libraries like libsodium which is IMO what "cool kids" tend to use nowadays. If you have some spare time, could you please analyse what we are missing in comparison to libsodium?

From your list I agree with XSalsa20 + SIV but the rest are rarely used and IMO mostly not worth the effort (but I might be wrong; if you show me some real use-cases I may change my mind).

@DonaldTsang I think we should aim at features available in modern crypto libraries like libsodium which is IMO what "cool kids" tend to use nowadays. If you have some spare time, could you please analyse what we are missing in comparison to libsodium? From your list I agree with `XSalsa20` + `SIV` but the rest are rarely used and IMO mostly not worth the effort (but I might be wrong; if you show me some real use-cases I may change my mind).
LightBit commented 2018-03-01 12:45:25 -06:00 (Migrated from github.com)

@karel-m Should Salsa20 be extended to XSalsa20 (when longer IV is used) or should it be separate implementation?

@karel-m Should Salsa20 be extended to XSalsa20 (when longer IV is used) or should it be separate implementation?
sjaeckel commented 2018-03-01 13:05:55 -06:00 (Migrated from github.com)

@LightBit if Salsa20 can easily be turned into XSalsa20 at runtime, so both could use the same basis, I'm pro extension. Otherwise we'd have to have a look what's best.

@LightBit if Salsa20 can easily be turned into XSalsa20 at runtime, so both could use the same basis, I'm pro extension. Otherwise we'd have to have a look what's best.
karel-m commented 2018-03-01 13:07:00 -06:00 (Migrated from github.com)

ping @buggywhip ^^

ping @buggywhip ^^
LightBit commented 2018-03-01 13:32:16 -06:00 (Migrated from github.com)

@sjaeckel Due to salsa20_ivctr64(), extension would add 64 bytes overhead in state for Salsa20 to save key and IV. It would re-setup, if IV is different and longer than 8 bytes, else only counter would change.

@sjaeckel Due to salsa20_ivctr64(), extension would add 64 bytes overhead in state for Salsa20 to save key and IV. It would re-setup, if IV is different and longer than 8 bytes, else only counter would change.
karel-m commented 2018-03-01 16:08:46 -06:00 (Migrated from github.com)

Due to salsa20_ivctr64(), extension would ...

As salsa20 was not released yet (it is only in develop branch) we can still change its API if needed - e.g. incorporating salsa20_ivctr64 into salsa20_setup or/and introducing salsa20_xsetup.

> Due to salsa20_ivctr64(), extension would ... As `salsa20` was not released yet (it is only in `develop` branch) we can still change its API if needed - e.g. incorporating `salsa20_ivctr64` into `salsa20_setup` or/and introducing `salsa20_xsetup`.
sjaeckel commented 2018-03-01 16:28:55 -06:00 (Migrated from github.com)

As salsa20 was not released yet (it is only in develop branch) we can still change its API if needed

yep

e.g. incorporating salsa20_ivctr64 into salsa20_setup or/and introducing salsa20_xsetup.

whoever wants to add xsalsa20 should just do it (preferably based on our salsa20)
we'll then bring it in form together if required :)

> As salsa20 was not released yet (it is only in develop branch) we can still change its API if needed yep > e.g. incorporating salsa20_ivctr64 into salsa20_setup or/and introducing salsa20_xsetup. whoever wants to add xsalsa20 should just do it (preferably based on our salsa20) we'll then bring it in form together if required :)
buggywhip commented 2018-03-01 18:45:32 -06:00 (Migrated from github.com)

whoever wants to add xsalsa20 should just do it (preferably based on our salsa20)
we'll then bring it in form together if required :)

I'm willing to take this on but need to finish my current project. ...or at least get to a good stopping point. ...perhaps in a week or two?

> whoever wants to add xsalsa20 should just do it (preferably based on our salsa20) > we'll then bring it in form together if required :) > I'm willing to take this on but need to finish my current project. ...or at least get to a good stopping point. ...perhaps in a week or two?
DonaldTsang commented 2018-03-02 00:44:48 -06:00 (Migrated from github.com)

@karel-m The reason I suggest adding legacy ciphers to the library is to allow future cryptographers to play around with it and test out new ideas.
The hashes from SPHLib is already being used in thousands of cryptocurrencies and tokens (see: X11, X13, X15)

@karel-m The reason I suggest adding legacy ciphers to the library is to allow future cryptographers to play around with it and test out new ideas. The hashes from SPHLib is already being used in thousands of cryptocurrencies and tokens (see: X11, X13, X15)
karel-m commented 2018-03-04 13:04:18 -06:00 (Migrated from github.com)

When talking about xsalsa20 it may be also a good idea to consider xchacha20 + xchacha20poly1305 (which are supported e.g. by libsodium)

When talking about `xsalsa20` it may be also a good idea to consider `xchacha20` + `xchacha20poly1305` (which are supported e.g. by libsodium)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#346
No description provided.