ECDH with key in Android Key Store

2019-05-21 09:22发布

I'm developping an Android App that generates an EC Asymetric key. When my app gets connected to a device, they exchange their public key. They then use ECDH to establish a shared secret. This shared secret is then used to derive an AES session key. All this is working fine.

I'm now working on the storage of the asymetric key. I wanted to put it in the Android KeyStore but I don't see how I can then do the ECDH operation. The key in the key store can be used to sign, decrypt or encrypt but I don't see the possibility to do ECDH operation. Is it possible?

While browsing SO, I have seen this discussion which says that it is not possible. If that's the case, how can I "secure" my asymetric key?

Thanks

1条回答
等我变得足够好
2楼-- · 2019-05-21 10:05

ECDH is not currently supported by AndroidKeyStore as you can see here https://developer.android.com/training/articles/keystore

The alternative to store securely the key pair into the device is to use an encryption key managed by AndroidKeyStore to encrypt the EC private key.

You can use a RSA or AES key depending on your target version. See how to securely store encryption keys in android?

查看更多
登录 后发表回答