Re: AES and EVP_CIPHER question

2022-05-18 Thread Matt Caswell
On 17/05/2022 16:25, Philip Prindeville wrote: Thanks, and for 1.1.x? There's nothing equivalent in 1.1.x AFAIK. Matt

Re: AES and EVP_CIPHER question

2022-05-17 Thread Philip Prindeville
> On May 17, 2022, at 4:32 AM, Matt Caswell wrote: > > > > On 16/05/2022 23:48, Philip Prindeville wrote: >> Sorry, I shouldn't have phrased that inartfully. >> There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something >> analogous? > > > From 3.0, assuming you are using

Re: AES and EVP_CIPHER question

2022-05-17 Thread Matt Caswell
On 16/05/2022 23:48, Philip Prindeville wrote: Sorry, I shouldn't have phrased that inartfully. There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something analogous? From 3.0, assuming you are using provided ciphers (i.e. not engine ones), then OSSL_CIPHER_PARAM_PADDING

Re: AES and EVP_CIPHER question

2022-05-16 Thread Philip Prindeville
Sorry, I shouldn't have phrased that inartfully. There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something analogous? > On May 16, 2022, at 1:00 PM, Philip Prindeville > wrote: > > Thanks. That fixed the return value of EVP_CipherFinal(). > > Is there a reciprocal EVP_CIP

Re: AES and EVP_CIPHER question

2022-05-16 Thread Philip Prindeville
Thanks. That fixed the return value of EVP_CipherFinal(). Is there a reciprocal EVP_CIPHER_CTX_get_padding() method to find out what the default padding method is for ECB? > On May 16, 2022, at 12:41 AM, Tomas Mraz wrote: > > The EVP_CIPHER_CTX_set_padding(ctx, 0) must be called after the >

Re: AES and EVP_CIPHER question

2022-05-15 Thread Tomas Mraz
The EVP_CIPHER_CTX_set_padding(ctx, 0) must be called after the EVP_CipherInit() to have an effect. Also what is the AST_CRYPTO_AES_BLOCKSIZE value? Is it in bits (i.e, 128)? Also res should be initialized to -1 so you do not return uninitialized value on error. Tomas Mraz On Fri, 2022-05-13 at

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
Here's a simple/stupid test program and its output, running on Ubuntu 20.04 LTS: OpenSSL 1.1.1f 31 Mar 2020 EVP_CIPHER_CTX_new returns 0x5627171042a0 EVP_CipherInit returns 1 EVP_CipherUpdate returns 1, outlen = 0 buf: 'Mary had a littl' EVP_CipherFinal returns 0, finallen = 0 buf: 'Mary had a li

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
> On May 13, 2022, at 10:55 AM, Philip Prindeville > wrote: > > > >> On May 13, 2022, at 10:34 AM, Matt Caswell wrote: >> >> >> >> On 13/05/2022 16:49, Philip Prindeville wrote: >>> Hi, >>> I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's >>> forward compatible

Re: AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
> On May 13, 2022, at 10:34 AM, Matt Caswell wrote: > > > > On 13/05/2022 16:49, Philip Prindeville wrote: >> Hi, >> I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's >> forward compatible into 3.x. >> My code, in a nutshell, looks like: >> static int evp_cipher_aes_d

Re: AES and EVP_CIPHER question

2022-05-13 Thread Matt Caswell
On 13/05/2022 16:49, Philip Prindeville wrote: Hi, I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's forward compatible into 3.x. My code, in a nutshell, looks like: static int evp_cipher_aes_decrypt(const unsigned char *in, unsigned char *out, unsigned inlen, const

AES and EVP_CIPHER question

2022-05-13 Thread Philip Prindeville
Hi, I'm trying to rewrite some legacy AES_* code to use EVP_CIPHER_* so it's forward compatible into 3.x. My code, in a nutshell, looks like: static int evp_cipher_aes_decrypt(const unsigned char *in, unsigned char *out, unsigned inlen, const ast_aes_decrypt_key *key) { EVP_CIPHER_CTX

Re: [openssl-users] EVP_EncryptUpdate and EVP_CIPHER callback do_cipher

2016-04-18 Thread Dmitry Belyavsky
Dear Matt, On Mon, Apr 18, 2016 at 6:00 PM, Matt Caswell wrote: > > > On 18/04/16 15:55, Dmitry Belyavsky wrote: > > Hello, > > > > Could anybody explain how to deal with the output length in the > > EVP_EncryptUpdate? > > > > The function EVP_EncryptUpdate has the outl output parameter, which i

Re: [openssl-users] EVP_EncryptUpdate and EVP_CIPHER callback do_cipher

2016-04-18 Thread Matt Caswell
On 18/04/16 15:55, Dmitry Belyavsky wrote: > Hello, > > Could anybody explain how to deal with the output length in the > EVP_EncryptUpdate? > > The function EVP_EncryptUpdate has the outl output parameter, which is > designed for returning the length of the resulting ciphertext. Then > interna

[openssl-users] EVP_EncryptUpdate and EVP_CIPHER callback do_cipher

2016-04-18 Thread Dmitry Belyavsky
Hello, Could anybody explain how to deal with the output length in the EVP_EncryptUpdate? The function EVP_EncryptUpdate has the outl output parameter, which is designed for returning the length of the resulting ciphertext. Then internally it calls the do_cipher callback which does not take such

Crypto engine EVP_CIPHER structure - cleanup

2012-10-03 Thread Gnanasekar R
Hi, I have a crypto engine to perform AES encryption/decryption. I have initialized the EVP_CIPHER structure with the needed function pointers. I get called in "init" where I do some bookkeeping(could be assigning a context id). When this context is over I would like to remove any boo

Re: EVP_Cipher()

2011-09-26 Thread Dr. Stephen Henson
On Sun, Sep 25, 2011, Paul Suhler wrote: > Hi, everyone. > > > > (This got no response on the developers list, so I'll retry it here.) > > > > Should EVP_Cipher() be used? I've found an inconsistency in its return > values: For the cipher EVP_ae

EVP_Cipher()

2011-09-25 Thread Paul Suhler
Hi, everyone. (This got no response on the developers list, so I'll retry it here.) Should EVP_Cipher() be used? I've found an inconsistency in its return values: For the cipher EVP_aes_256_gcm, successful decryption returns the length of the input. (That's what aes_gcm_c

EVP_Cipher()

2009-09-02 Thread Xu, Qiang (FXSGSC)
Hi, all: It is understood that EVP_Cipher() is used in libssh2, but I am not sure from which release of openssl this function is introduced. Can anybody tell me this information? By the way, how to check the version of openssl in my linux box? If it is not a version that has the definition of

EVP_CIPHER structure

2009-07-22 Thread siavash_f2002
rypto\evp\evp_enc.c:330:i guess that my EVP_CIPHER structure is not defined correctly. TEA encryption algorithm:http://www.gelato.unsw.edu.au/lxr/source/crypto/tea.c Thanks in advance,Siavash

Re: Where is the EVP_CIPHER defined?

2009-02-18 Thread sofian sindhi
2009/2/18 Ger Hobbelt > On Tue, Feb 17, 2009 at 12:49 PM, sofian sindhi > wrote: > > Dear all: > > I trace openssl recently and I cannot find where the location of > EVP_CIPHERs > > defined in evp.h. > > In evp.h, it is declared as const EVP_CIPHER *EVP_camelli

Re: Where is the EVP_CIPHER defined?

2009-02-17 Thread Ger Hobbelt
On Tue, Feb 17, 2009 at 12:49 PM, sofian sindhi wrote: > Dear all: > I trace openssl recently and I cannot find where the location of EVP_CIPHERs > defined in evp.h. > In evp.h, it is declared as const EVP_CIPHER *EVP_camellia_128_ecb(void); > But where is the trully EVP_camell

Where is the EVP_CIPHER defined?

2009-02-17 Thread sofian sindhi
Dear all: I trace openssl recently and I cannot find where the location of EVP_CIPHERs defined in evp.h. In evp.h, it is declared as const EVP_CIPHER *EVP_camellia_128_ecb(void); But where is the trully EVP_camellia_128_ecb(void) located? I have grepped the source but I cannot get any hint

Where is the EVP_CIPHER defined?

2009-02-17 Thread sofian sindhi
Dear all: I trace openssl recently and I cannot find where the location of EVP_CIPHERs defined in evp.h. In evp.h, it is declared as const EVP_CIPHER *EVP_camellia_128_ecb(void); But where is the trully EVP_camellia_128_ecb(void) located? I have grepped the source but I cannot get any hint

HELP! A strange PROBLEM when loading a EVP_CIPHER object in my smime application

2006-03-20 Thread li gh
Hi,I am implementing a linux application about smime, it requires loading private-key for decryption. I rewrite the load_key function just the same as OpenSSL. But It returns a NULL pointer.By debugging, I found that an error may occurs when adding ciphers to the hash table. The EVP_CIPHER object

Re: Using RC4 vs EVP_CIPHER

2005-05-11 Thread Sean Covel
Steve, > > Salt shouldn't be predictable so using a fixed string isn't an option but it > isn't secret. > I'm using rand_bytes() to create the salt. > >>IV. I should really use an IV with some modes. Again, its random >>bytes, but it doesn't have to be secret. I will also have to transmit

Re: Using RC4 vs EVP_CIPHER

2005-05-10 Thread Dr. Stephen Henson
On Tue, May 10, 2005, Sean Covel wrote: > Steve, > > > > >>Additionally you seem to be using an unsalted key derivation algorithm with > >>a > >>stream cipher (RC4). If passwords are reused then I hope you aren't sending > >>anything sensitive that way because that is an insecure combination. >

Re: Using RC4 vs EVP_CIPHER

2005-05-10 Thread Sean Covel
Steve, > >>Additionally you seem to be using an unsalted key derivation algorithm with a >>stream cipher (RC4). If passwords are reused then I hope you aren't sending >>anything sensitive that way because that is an insecure combination. >> > Additional Questions: SALT isn't secret, correct?

Re: Using RC4 vs EVP_CIPHER

2005-04-29 Thread Sean Covel
Steve, Dr. Stephen Henson wrote: [snip] >>Here are the relevant chunks for code. I'm trying to give enough code >>without over-burdening you. If you need more, let me know. >> > > [snip] > > Here's one problem: > > >>EVP_CIPHER_CTX_set_key_length(&Dctx, 128); > > > the length para

Re: Using RC4 vs EVP_CIPHER

2005-04-29 Thread Dr. Stephen Henson
On Mon, Apr 25, 2005, Sean Covel wrote: > Now that I've updated to the latest OpenSSL (7g) I've got a question: > > I implemented some RC4 functionality using the low-level rc4 functions.( > RC4_Set_Key, RC4), and its working fine. > > The OpenSSL documentation recommends using the EVP_* functio

Re: Using RC4 vs EVP_CIPHER

2005-04-25 Thread Sean Covel
I'm continuing to test. I've noticed something else strange with the EVP_ functions... I have a test program that reads in text file "A" a chunk at a time, encrypts the chunk, then writes it out to "B". It then reads "B" back in a chunk at a time, decrypts it, and writes it back out to "C". Simp

Using RC4 vs EVP_CIPHER

2005-04-25 Thread Sean Covel
Now that I've updated to the latest OpenSSL (7g) I've got a question: I implemented some RC4 functionality using the low-level rc4 functions.( RC4_Set_Key, RC4), and its working fine. The OpenSSL documentation recommends using the EVP_* functions instead of the lower level functions. It seems li

Re: Is it possible to set IV length in EVP_Cipher?

2005-03-11 Thread Dr. Stephen Henson
On Fri, Mar 11, 2005, Antonio Ruiz Martínez wrote: > Hola! > > > Thanks for your answer. > Mozilla is using a IV of 12 bytes length. I don't know why. That is the > reason because I asked if it was possible to use another differente > length in the IV. > What makes you think Mozilla is usi

Re: Is it possible to set IV length in EVP_Cipher?

2005-03-11 Thread Antonio Ruiz Martínez
Hola!     Dr. Stephen Henson wrote: On Tue, Mar 08, 2005, Antonio Ruiz Martínez wrote: Hello! I have been looking at how I can set the length of the iv parameters in a cipher algorithm. I saw that we can put the IV with EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, do_dec

Re: Is it possible to set IV length in EVP_Cipher?

2005-03-08 Thread Dr. Stephen Henson
On Tue, Mar 08, 2005, Antonio Ruiz Martínez wrote: > Hello! > >I have been looking at how I can set the length of the iv parameters > in a cipher algorithm. >I saw that we can put the IV with EVP_CipherInit_ex(ctx, NULL, NULL, > key, iv, do_decrypt); >However this length, in RC2_CBC

Is it possible to set IV length in EVP_Cipher?

2005-03-08 Thread Antonio Ruiz Martínez
Hello! I have been looking at how I can set the length of the iv parameters in a cipher algorithm. I saw that we can put the IV with EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, do_decrypt); However this length, in RC2_CBC, is 8 bytes I don't know if it is possible to use another differe

Re: Implementing EVP_CIPHER and EVP_DIGEST, using external hardware for engine

2004-10-18 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Mon, 18 Oct 2004 20:25:25 +0530, "Rahaman, Riaz UR" <[EMAIL PROTECTED]> said: riazrahaman> I am trying to use the external engine for my riazrahaman> crytography but I am not able to understand how to riazrahaman> implement EVP

Implementing EVP_CIPHER and EVP_DIGEST, using external hardware for engine

2004-10-18 Thread Rahaman, Riaz UR
Title: Message Hi  I am trying to use the external engine for my crytography but I amnot able to understand how to implement EVP_CIPHER and EVP_DIGEST.Also i cant get hold of all the hooks that need to be placed forgetting my external engine up and running. If any one has already donethis

Implementing EVP_CIPHER and EVP_DIGEST, using external hardware for engine

2004-10-18 Thread Riaz Rahaman
Hi I am trying to use the external engine for my crytography but I am not able to understand how to implement EVP_CIPHER and EVP_DIGEST. Also i cant get hold of all the hooks that need to be placed for getting my external engine up and running. If any one has already done this sort of

Re: Encrypt/Decrypt using EVP_Cipher functions - repost PLEASE HELP

2004-04-22 Thread Dr. Stephen Henson
On Thu, Apr 22, 2004, Eric Morris wrote: > Dr. Henson, > > Can you interleave encryption and decryption without repeated calls to > EVP_CipherInit and/or EVP_CipherFinal? > If not, which calls are required between encryption calls and decryption > calls? > As I indicated you are best using tw

Re: Encrypt/Decrypt using EVP_Cipher functions - repost PLEASE HELP

2004-04-22 Thread Eric Morris
Dr. Henson, Can you interleave encryption and decryption without repeated calls to EVP_CipherInit and/or EVP_CipherFinal? If not, which calls are required between encryption calls and decryption calls? Thanks for the help - Eric Morris Dr. Stephen Henson wrote: On Thu, Apr 22, 2004, Er

Re: Encrypt/Decrypt using EVP_Cipher functions - repost PLEASE HELP

2004-04-22 Thread Dr. Stephen Henson
On Thu, Apr 22, 2004, Eric Morris wrote: > I have a situation where an application may switch from reading to > writing and back again at random. Do I need a ctx context each for > decryption / encryption, or can I use the same ctx in sequence on the file? > > When switching from reading to wr

Encrypt/Decrypt using EVP_Cipher functions - repost PLEASE HELP

2004-04-22 Thread Eric Morris
I have a situation where an application may switch from reading to writing and back again at random. Do I need a ctx context each for decryption / encryption, or can I use the same ctx in sequence on the file? When switching from reading to writing (and vice versa), do I need to detect this ch

Encryption / Decryption with the EVP_Cipher interface

2004-04-21 Thread Eric Morris
I have an application where an application may switch from reading to writing and back again at random. I've determined that either I need a ctx context each for decryption / encryption, or I use the same ctx in sequence on the file. I presume that I need to detect this change and call EVP_Ciph

How to use the EVP_CIPHER functions...

2000-11-13 Thread suram
Hi  everyone,   I have figured out how to perform the DES cryption using the DES functions.  But I want to know how to do the same using the EVP_CIPHER routines.  It is given in the documentation that "The EVP cipher routines are a high level interface to certain symmetric ciphers.&quo

Re: EVP_Cipher

1999-01-30 Thread Ralf S. Engelschall
In article <8EA6B79EE58DD211AF8C006008A980780FC6A9@SA1_0010> you wrote: > I am encrypting data using function EVP_Cipher. I would like to know if it > is possible to encrypt data by this fcion 'in place' as shown here: > EVP_Cipher(ds, buf, buf, l); > wher

EVP_Cipher

1999-01-13 Thread siska . julius
I am encrypting data using function EVP_Cipher. I would like to know if it is possible to encrypt data by this fcion 'in place' as shown here: EVP_Cipher(ds, buf, buf, l); where 'ds' is encryption context and 'l' is length of encrypted data, buf is buffe