Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of Chinese national cryptography standards #1463

Open
Tommo-L opened this issue Mar 6, 2020 · 8 comments
Open

Add support of Chinese national cryptography standards #1463

Tommo-L opened this issue Mar 6, 2020 · 8 comments
Labels
Question Used in questions

Comments

@Tommo-L
Copy link
Contributor

Tommo-L commented Mar 6, 2020

This isn't an urgent issue, we can just discuss it, maybe we can do it in the future.

Q1: Do we need to support this cryptography standards?

In my opinion, we should support it as some dapps may need, and also consider for legality.

Q2: If we want to support, how do we implement it?

  • Option1: use bouncy castle library, which already support.
  • Option2: develop the library by ourselves. (It may depend on BC libray)
  • Option3: waiting for Microsoft.

Reference

  1. Chinese national cryptography standards (SM2)
  2. Chinese national SM3 standards
  3. GmSSL Project
  4. SM2Java
  5. SM2_SM3_SM4Encrypt (java)
  6. Bouncy Castle (support SM2/SM3 already)
@Tommo-L Tommo-L added the Question Used in questions label Mar 6, 2020
@erikzhang
Copy link
Member

I vote for option 2.

@ShawnYun
Copy link
Contributor

ShawnYun commented Mar 6, 2020

Supporting Chinese national cryptography standards is helpful for dapps development in China.

@Tommo-L Tommo-L changed the title Do we need to add support of Chinese national cryptography standards Add support of Chinese national cryptography standards Mar 11, 2020
@shargon
Copy link
Member

shargon commented Mar 17, 2020

#1419 already has secp256k1 without BC

@roman-khimov
Copy link
Contributor

To be fair, I don't think it's a good idea for a public chain. IMO it makes sense to make crypto pluggable and changeable for various private networks, but to stick with one set of crypto primitives for public network.

Suppose you've added Chinese crypto, now how about GOST? How about various other standards or just some nice algorithms like ed25519? You may very soon easily end up with a full-blown openssl inside this way, and I don't think that's what we want.

@Tommo-L
Copy link
Contributor Author

Tommo-L commented Mar 18, 2020

IMO it makes sense to make crypto pluggable and changeable for various private networks, but to stick with one set of crypto primitives for public network.

Agree.

For me, another reason that we hope to add SM2, is for legality reason.

@roman-khimov
Copy link
Contributor

YMMV with SM2, but my experience with GOST algorithms tells me that usually they're used in some regulated environments and usually using them implies some kind of certification that in turn may require strictly not having non-locally-standardized algorithms. So it's not that you're required to have GOST, but you're required to have just it and nothing else, which is impossible for public blockchain.

@Tommo-L
Copy link
Contributor Author

Tommo-L commented Mar 19, 2020

So it's not that you're required to have GOST, but you're required to have just it and nothing else, which is impossible for public blockchain.

This is a real possibility. We are not trying to solve all the problems, but we are trying to solve some projects' requirements and possible legality issues, just like os which supports different languages in different countries.

At the moment we'll not add, just do some research work. Only when some projects have the requirements, we will consider adding.

@doubiliu
Copy link
Contributor

Each country or region may have different technical standards.Indeed, it is a bit bloated to be compatible and use all the standards in NEO's mainnet.But NEO is not just a public chain, it is also a protocol.Users can do what they want to do according to this protocol, not only the main network, but also their own private network.We should help with such needs.So I think we should abstract the existing encryption method and put the specific implementation into the plug-in or independent class library. Of course, the main network needs to specify the corresponding encryption standard, which can be stored in the configuration file.This will be a long term job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Used in questions
Projects
None yet
Development

No branches or pull requests

6 participants