You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package appears to have a bug where it will randomly produce a ciphertext it cannot decipher. This is easily reproducible with the following Go program, largely based on the example in the Readme:
package main
import (
"log"
ecies "github.com/ecies/go/v2"
)
funcmain() {
k, err:=ecies.GenerateKey()
iferr!=nil {
panic(err)
}
log.Println("key pair has been generated")
for {
ciphertext, err:=ecies.Encrypt(k.PublicKey, []byte("THIS IS THE TEST"))
iferr!=nil {
panic(err)
}
_, err=ecies.Decrypt(k, ciphertext)
iferr!=nil {
panic(err)
}
}
}
The expectation is that this program loops forever, however, what actually happens is that after a certain number of iterations (usually in the order of a few thousand), Decrypt will fail with an error: "invalid public key". This is because the Encrypt function is rarely producing a ciphertext that does not appear to be valid.
The text was updated successfully, but these errors were encountered:
gmaiainc
added a commit
to gmaiainc/ecies-go
that referenced
this issue
Dec 14, 2023
The package appears to have a bug where it will randomly produce a ciphertext it cannot decipher. This is easily reproducible with the following Go program, largely based on the example in the Readme:
The expectation is that this program loops forever, however, what actually happens is that after a certain number of iterations (usually in the order of a few thousand),
Decrypt
will fail with an error: "invalid public key". This is because the Encrypt function is rarely producing a ciphertext that does not appear to be valid.The text was updated successfully, but these errors were encountered: