ecdhe

Using TLS in Android

流过昼夜 提交于 2019-12-25 06:30:47
问题 I'm developing an Android application that communicates with my device(ARM based device with bluetooth module) via bluetooth using TLS(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256). What I considered: javax.net.ssl from Android. Problem is that ephemeral(ECDH E ) encryption keys are starting from API 20 but I need API 11. I didn't find a way to add suite. It seems that this library is strongly related to android version. API versions and overview Bouncycastle(spongycastle) I didn't find a way to use

Exporting shared secret as BYTE array from BCRYPT_SECRET_HANDLE

亡梦爱人 提交于 2019-12-10 22:17:02
问题 I'm implementing ECDHE using crypto next generation APIs (CNG). I generate public and private keys successfully. For pre-shared key, I use BCryptSecretAgreement API, which returns me the pre-shared key secret handle (BCRYPT_SECRET_HANDLE). How can I export the pre-shared key as BYTE array from the BCRYPT_SECRET_HANDLE? 回答1: Starting with Windows 10, you can call BCryptDeriveKey() with BCRYPT_KDF_RAW_SECRET . The resulting key data is the raw secret. Note 1: bcrypt.h indicates that this format