Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8811455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:22:11+00:00 2026-06-14T03:22:11+00:00

I am using the openssl library in order to decrypt some raw strings that

  • 0

I am using the openssl library in order to decrypt some raw strings that come from a device.

The encryption that the device is using is AES – 128 bit.

Here is my code :

unsigned char *aes_decrypt(EVP_CIPHER_CTX *e, unsigned char *ciphertext, int *len)
{
  int p_len = *len, f_len = 0;
  unsigned char *plaintext = new unsigned char [p_len + 128];
  memset(plaintext,0,p_len + 128);
  syslog(LOG_NOTICE,"P_LEN BEFORE: %d",p_len);
  EVP_DecryptInit_ex(e, NULL, NULL, NULL, NULL);
  EVP_DecryptUpdate(e, plaintext, &p_len, ciphertext, *len);
  EVP_DecryptFinal_ex(e, plaintext+p_len, &f_len);

  syslog(LOG_NOTICE,"P_LEN : %d",p_len);
  syslog(LOG_NOTICE,"F_LEN : %d",f_len);
  *len = p_len + f_len;

  syslog(LOG_NOTICE,"MARIMEA ESTE %d",*len);
  return plaintext;
}

My questions are :

  1. Is the encrypted string length equal to the decrypted string length? (in AES 128 bit)

  2. If f_len represents the decrypted amount of bytes (correct me if I am wrong) then why is it smaller than the actual data decrypted?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:22:13+00:00Added an answer on June 14, 2026 at 3:22 am

    AES-128 is a block cipher. Block size is 128 bits (16 bytes). So length of ciphertext is always a multiple of 16 bytes. So the ciphertext can be bigger than plaintext.

    EDIT:

    Answers:

    1. No, encrypted data can be bigger or equal length.
    2. Wrong, f_len does represents the decrypted amount of bytes. (p_len + f_len) does it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using blowfish algorithm from openssl library, one can encrypt and decrypt any data.
I have a legacy C++ module that offers encryption/decryption using the openssl library (DES
I'd like to use the OpenSSL library to decrypt some AES data. The code
I'm looking for an example of using OpenSSL's AES CCM encryption. Apparently, this is
I'm using the pyOpenSSL interface to the OpenSSL library but it is missing some
I am trying to decrypt the AES 128 bit Video stream from Iphone captured
I'm using Ruby's standard OpenSSL library. It has a method called random_iv that generates
I'm using the openssl utility of debian in order to create a certificate. The
I am trying to take an AES HMAC of a file using the openssl
I'm encrypting a text (just a string) using OpenSSL's CMS library. I've implemented a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.