ECDSA verification


 
Thread Tools Search this Thread
Top Forums Programming ECDSA verification
# 1  
Old 05-24-2016
ECDSA verification

Using ECDSA, how do you verify integrity of Data (D), Given the value for the following:
Random number (r)
Signature (s)
ECpublic Key (K)

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Can't get past google verification

Trying to register the Verification step is blocking me. I've allowed all the intrusive Google trackers and Java. Tried different browsers with no blocking. Nothing is working. Says: "Try again later Your computer maybe ... " What weird is in this forum section I can pass the recaptcha but in... (1 Reply)
Discussion started by: Unregistered
1 Replies

2. Shell Programming and Scripting

Help about comment verification

Hello, I have a file, in which line 40 is commented. It is basically a cron job, #05,35,50 * * * * /usr/local/scripts/my.sh how i can i verify the line 40 is commented, if not then give me message not commented, otherwise provide us message it is commented. (5 Replies)
Discussion started by: learnbash
5 Replies

3. Shell Programming and Scripting

Field verification script help

Hello again unix.com I need some help regarding a script. I have: function checkform ( form ) { if (form.pass.value.length < 6) { alert( "Error." ); form.pass.focus(); document.getElementById('pass').style.backgroundColor="#FFFFFF"; return... (2 Replies)
Discussion started by: galford
2 Replies

4. Shell Programming and Scripting

Verification on shell script

hello i have writing a shell script to download and run some packages the only way that i use to verify download pack is , limit users ip to download from main server, if wget can download file (verified) then script run by execute it sh pack76.sh else show and error (stupid solution ha?) ... (8 Replies)
Discussion started by: nimafire
8 Replies

5. Solaris

Verification of the Boot Block

Guys, I have a rusty question that I need help with. It has been a while since I supoprted Solaris boxes. I have several hundred solaris systems running Sol 8 and Sol 10. I built the original 250 but they have added several hundred more and I am seeing issues with these boxes that I need to... (2 Replies)
Discussion started by: scottzx7rr
2 Replies

6. Shell Programming and Scripting

Script Verification

Hi eveyone I am planning to use crontab to delete all files in my donwloads directory that are older than one hour I will be using crontab to run this script find /home/kee/downloads/* -daystart -mmin +59 -type f -name -exec rm -r {}\; could you please let me know if the above... (1 Reply)
Discussion started by: k33k00
1 Replies

7. AIX

HACMP verification

Hi, every midnight hacmp verification is run automatically. clverify.log says there is no erro bu clutils.log says there is 1 error but when i look at the clverify.log no problem at all. Below is the output of the clverify.log what may be the cause of the error in the clutils.log file. Thanks,... (1 Reply)
Discussion started by: mmersoylu
1 Replies

8. Programming

htable + verification

hello every body, I have to verifiy if the param_key is selectionned twice or more and to print only one occurence i'm using htable what's the good implementation to add to the code to verify this. code : { char *tmpStr = NULL; ght_iterator_t iterator_param; void... (0 Replies)
Discussion started by: kamel.seg
0 Replies

9. UNIX for Dummies Questions & Answers

verification?

I'm really new at this and wondering how I would go about adding code to my script to verify that all records loaded successfully? (I am loading a file into a table) i'm using the Korn shell. I'm also having trouble verifying parts in the header as i do not really understand the header and... (3 Replies)
Discussion started by: sheranjem
3 Replies

10. Shell Programming and Scripting

ftp file verification

I need a simple method to verify that an automated ftp script was successful. The ftp command can exit without error and the file may not have been successfully sent. It's rare, but it happens. I could write a script that would use md5sum before and after sending the file. But, what I really... (7 Replies)
Discussion started by: gopat
7 Replies
Login or Register to Ask a Question
ecdsa(3openssl) 						      OpenSSL							   ecdsa(3openssl)

NAME
ecdsa - Elliptic Curve Digital Signature Algorithm SYNOPSIS
#include <openssl/ecdsa.h> ECDSA_SIG* ECDSA_SIG_new(void); void ECDSA_SIG_free(ECDSA_SIG *sig); int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len, EC_KEY *eckey); ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY* eckey); int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp); int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, const unsigned char *sig, int siglen, EC_KEY *eckey); int ECDSA_size(const EC_KEY *eckey); const ECDSA_METHOD* ECDSA_OpenSSL(void); void ECDSA_set_default_method(const ECDSA_METHOD *meth); const ECDSA_METHOD* ECDSA_get_default_method(void); int ECDSA_set_method(EC_KEY *eckey,const ECDSA_METHOD *meth); int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); void* ECDSA_get_ex_data(EC_KEY *d, int idx); DESCRIPTION
The ECDSA_SIG structure consists of two BIGNUMs for the r and s value of a ECDSA signature (see X9.62 or FIPS 186-2). struct { BIGNUM *r; BIGNUM *s; } ECDSA_SIG; ECDSA_SIG_new() allocates a new ECDSA_SIG structure (note: this function also allocates the BIGNUMs) and initialize it. ECDSA_SIG_free() frees the ECDSA_SIG structure sig. i2d_ECDSA_SIG() creates the DER encoding of the ECDSA signature sig and writes the encoded signature to *pp (note: if pp is NULL i2d_ECDSA_SIG returns the expected length in bytes of the DER encoded signature). i2d_ECDSA_SIG returns the length of the DER encoded sig- nature (or 0 on error). d2i_ECDSA_SIG() decodes a DER encoded ECDSA signature and returns the decoded signature in a newly allocated ECDSA_SIG structure. *sig points to the buffer containing the DER encoded signature of size len. ECDSA_size() returns the maximum length of a DER encoded ECDSA signature created with the private EC key eckey. ECDSA_sign_setup() may be used to precompute parts of the signing operation. eckey is the private EC key and ctx is a pointer to BN_CTX structure (or NULL). The precomputed values or returned in kinv and rp and can be used in a later call to ECDSA_sign_ex or ECDSA_do_sign_ex. ECDSA_sign() is wrapper function for ECDSA_sign_ex with kinv and rp set to NULL. ECDSA_sign_ex() computes a digital signature of the dgstlen bytes hash value dgst using the private EC key eckey and the optional pre-com- puted values kinv and rp. The DER encoded signatures is stored in sig and it's length is returned in sig_len. Note: sig must point to ECDSA_size bytes of memory. The parameter type is ignored. ECDSA_verify() verifies that the signature in sig of size siglen is a valid ECDSA signature of the hash value value dgst of size dgstlen using the public key eckey. The parameter type is ignored. ECDSA_do_sign() is wrapper function for ECDSA_do_sign_ex with kinv and rp set to NULL. ECDSA_do_sign_ex() computes a digital signature of the dgst_len bytes hash value dgst using the private key eckey and the optional pre-com- puted values kinv and rp. The signature is returned in a newly allocated ECDSA_SIG structure (or NULL on error). ECDSA_do_verify() verifies that the signature sig is a valid ECDSA signature of the hash value dgst of size dgst_len using the public key eckey. RETURN VALUES
ECDSA_size() returns the maximum length signature or 0 on error. ECDSA_sign_setup() and ECDSA_sign() return 1 if successful or -1 on error. ECDSA_verify() and ECDSA_do_verify() return 1 for a valid signature, 0 for an invalid signature and -1 on error. The error codes can be obtained by ERR_get_error(3). EXAMPLES
Creating a ECDSA signature of given SHA-1 hash value using the named curve secp192k1. First step: create a EC_KEY object (note: this part is not ECDSA specific) int ret; ECDSA_SIG *sig; EC_KEY *eckey = EC_KEY_new(); if (eckey == NULL) { /* error */ } key->group = EC_GROUP_new_by_nid(NID_secp192k1); if (key->group == NULL) { /* error */ } if (!EC_KEY_generate_key(eckey)) { /* error */ } Second step: compute the ECDSA signature of a SHA-1 hash value using ECDSA_do_sign sig = ECDSA_do_sign(digest, 20, eckey); if (sig == NULL) { /* error */ } or using ECDSA_sign unsigned char *buffer, *pp; int buf_len; buf_len = ECDSA_size(eckey); buffer = OPENSSL_malloc(buf_len); pp = buffer; if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey); { /* error */ } Third step: verify the created ECDSA signature using ECDSA_do_verify ret = ECDSA_do_verify(digest, 20, sig, eckey); or using ECDSA_verify ret = ECDSA_verify(0, digest, 20, buffer, buf_len, eckey); and finally evaluate the return value: if (ret == -1) { /* error */ } else if (ret == 0) { /* incorrect signature */ } else /* ret == 1 */ { /* signature ok */ } CONFORMING TO
ANSI X9.62, US Federal Information Processing Standard FIPS 186-2 (Digital Signature Standard, DSS) SEE ALSO
dsa(3), rsa(3) HISTORY
The ecdsa implementation was first introduced in OpenSSL 0.9.8 AUTHOR
Nils Larsch for the OpenSSL project (http://www.openssl.org). OpenSSL-0.9.8 Oct 11 2005 ecdsa(3openssl)