ecies | Elliptic Curve Integrated Encryption Scheme | Cryptography library
kandi X-RAY | ecies Summary
kandi X-RAY | ecies Summary
Elliptic Curve Integrated Encryption Scheme (ECIES)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ecies
ecies Key Features
ecies Examples and Code Snippets
Community Discussions
Trending Discussions on ecies
QUESTION
I'm curently working on a project were i need to compute an hkdf symetric key. To do that i need to generate a shared secret from the private key and an ephemeral public key.
For the rest of my work i did use pycryptodome but i can't find in the doc if it allow generation of shared secret. I saw in the futur plan their intention to add Elliptic Curves (ECIES, ECDH) since ecdh is based on shared key it wouldn't be suprising if shared key generation is not implemented yet.
I tried using the cryptography lib too but impossible to load my ephemeral key.
...ANSWER
Answered 2021-Nov-23 at 17:46With help of @Topaco i ended up making this function:
QUESTION
I want to encrypt and decrypt the message based on ECIES using this library JavaScript Elliptic curve cryptography library. I want to import my private key and get the public key from it because I do not have a new private key generated each time I run the code.
The code:
...ANSWER
Answered 2021-Mar-02 at 21:42eccrypto.getPublic()
expects a Buffer
as argument, not a string
. Try this instead:
QUESTION
Intro:
So I am new to JavaScript and I would like to know how I can use the return from an async function without using .then or anything of that sort (if not, then is it possible to use this in a way that I can access the return in scope of the signupData() function). So I am encrypting things with ECIES scheme using Secp256k1 keys to be sent to the API for later usage, however, I think the .encrypt under the encryptMes section in the post invokes a promise. Below is relevant code:
signup.html
...ANSWER
Answered 2021-Jan-24 at 09:25if your signupData func was async too then you could use the await keyword variable = await asyncfunct(params)
QUESTION
I've been having a really hard time figuring out how to store a Secp256k1 privateKey from multiple libraries (currently on this one for ECIES encryption: https://npm.io/package/@toruslabs/eccrypto).
I have tried encoding and decoding with base64, many implementations of functions that copy array buffer for input encoded string to localStoarge and corresponding output Uint8Array from localStorage, I tried it with IndexedDB, JSON.stringify and parse do not work with binary data, and so many more variations.
When I go through the array buffer elements individually to copy it into a new Uint8Array, I get a similar private key, but with two missing key/field's (parent and offset) which I believe is why every library I have tried so far returns something a long the lines of "bad private key" when I try generating the public key from them.
I am exhausted and I would like some professional insight for my lack of skill in this particular subject. So how can I store (in any way as long as it's client/local) a Secp256k1 private key in a way that if I call it from that persistent client sided data base, they can be used to generate the public keys?
...ANSWER
Answered 2021-Jan-10 at 11:48Apparently, the library that uses the private/public key (in this case being @toruslabs/eccrypto) requires a buffer parameter for the keys.
A simple solution would be to make the NodeJS Buffer available in the browser, through browserify. You will only need to include the NodeJS Buffer class to the window object when creating the browserify file, as shown:
QUESTION
It's been a few hours since I began reading about IndexedDB and I am having some issues. This is code I followed from https://medium.com/@AndyHaskell2013/build-a-basic-web-app-with-indexeddb-8ab4f83f8bda and https://gist.github.com/JamesMessinger/a0d6389a5d0e3a24814b and it's just put together poorly for comprehension's sake. So what I am trying to do is store a secret key into IndexedDB so that I can use it to encrypt things with the ECIES scheme.
Relevant code (sequential order):
...ANSWER
Answered 2021-Jan-06 at 20:19You probably created the database without the object store. to trigger onupgradeneeded
which will go and create the object store you have to connect to the database with a higher version number.
QUESTION
I am using eccrypto library in javascript for encryption using the ECIES algorithm (curve- secp256k1). The cipher generated by encryption in JS code could not be decrypted in Kotlin.
Here is the Javascript code.
...ANSWER
Answered 2020-Aug-27 at 18:32Your comment 'Encrypting the same message using the same public key in both environment gives different cipher messages' does not prove a difference between values. I encrypted 10 times the same message '123' with my public key and got 10 times a different encrypted value.
This is due to a random element in the (internal) encryption function:
QUESTION
I have wrote a function to encrypt a string because it's a sensitive information. I was running some testes and I have identified that the generated output is different on each run.
I'm not sure if it's related to salt or something like that.
Is a normal behavior the output be different each time is called? Is it a good practice or a bad practice?
...ANSWER
Answered 2020-Jun-24 at 16:18If the encrypted data were the same every time the function was called, the encryption would be insecure.
Consider:
- You want to send a message, either "attack" or "do not attack".
- An attacker intercepts the message.
- An attacker observes later that the recipient did not attack.
- An attacker intercepts the next message.
- The attacker compares the message to the previous message. If they are identical, the attacker knows the message says "do not attack". If they are not identical, the attacker knows the message says "attack".
In any event, the first thing you do when you encrypt something using ECIES is to create a random ephemeral key. So that key will be different every time.
QUESTION
I cannot understand how to build Botan for android, according on the instruction here:
$ export CXX=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++
$ ./configure.py --os=android --cc=clang --cpu=arm64
i cannot understand how to use this commands on Windows, also reading previous issues did not help me, can you tell me how did you build this library on windows step-by-step, just your command examples?
I used --cc-bin option of configure.py to specify the path to the compiler, it is considered a solution for windows, but what i have is:
...ANSWER
Answered 2020-Mar-21 at 22:13It seems Botan support for building Android binaries on Windows hosts is limited. You will have to use dark magic to make this work.
The build process consists of two phases, the configuration phase and the make phase.
The Android-specific instructions in the documentation you linked do not cover the whole build process, only the configuration phase. For the make phase, you then have to follow the Windows-specific instructions (link).
Configuration phase:You will need the following binaries, adjust the paths to your machine:
clang++ (note the
.cmd
at the end):C:\Development\android-ndk-r19c-windows-x86_64\android-ndk-r19c\toolchains\llvm\prebuilt\windows-x86_64\bin\armv7a-linux-androideabi28-clang++.cmd
ar:
C:\Development\android-ndk-r19c-windows-x86_64\android-ndk-r19c\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ar.exe
In the Botan folder, run the configure
command:
QUESTION
supposed we have global CryptoPP::ECIES::PrivateKey mykey
initialized object
,and have 10 threads that run CryptoPP::ECIES::Encryptor myencrypto(mykey)
for making a encryptor object by assigning key from mykey object
the assigner takes mykey as reference
do i need a Mutex to make sure that only one thread uses mykey at a time , or multi threads can assign enryptor from key object simultaneously without any problem (if yes , is that guaranteed)
(please note that threads only assign from the mykey simultaneously none of them modify it(my code doesn't don't know if the cryptoPP assigner does ))
...ANSWER
Answered 2020-Mar-05 at 21:11After not receiving an answer i picked the mutex locks from my code and tested a few time when PrivateKey object was used simultaneously by multi thread for initializing mutli encryptors
i was getting a assert at intger.cpp (cryptoPP lib source file) at line 2910
QUESTION
I'm trying to Store ECIES num0 PrivateKey with DEREncodePrivateKey to a std::string and reload it in num1 PrivateKey Object for testing. Problem is when key is loaded with BERDecodePrivateKey in second PrivateKey object it can't be validated (also tested encryption and decrypting without validation and didn't decrypt )
here's the code
...ANSWER
Answered 2020-Jan-18 at 18:19finally found what the problem is as @maarten-bodewes mentioned in comment the DER encoded private exponent doesn't determine the curve OID for the privateKey Object , so before BER Decoding and importing key we need to somehow determine the OID for the Object; the simplest way is to determine it when Initializing new Object above code changes to :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ecies
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page