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 9217591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:40:00+00:00 2026-06-18T02:40:00+00:00

So I am using node crypto library to decipher a binary file that is

  • 0

So I am using node crypto library to decipher a binary file that is encrypted by some other software which I have no control over. Using the following code, I am able to decrypt it successfully:

decipher = crypto.createDecipheriv('aes-128-ecb', password, iv);
decrypted = decipher.update(body, 'binary', 'utf8');

This is great, however it appears there are about 11 characters truncated from the end of my decrypted text. Which is weird because it’s over 11200 characters of plaintext. Now I suspect the reason is because I don’t have this line:

decrypted += decipher.final('utf8');

However, if I add that line, I get the error TypeError: DecipherFinal fail

I have tried different output encodings and without the IV, but with no luck. I have also read this question: What's wrong with nodejs crypto decipher? which seems like the same issue, however I don’t understand the steps I am supposed to take on the openssl command line, or how that would affect my node program.

  • 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-18T02:40:01+00:00Added an answer on June 18, 2026 at 2:40 am

    Have you tried setting auto padding to false? By default it sets it seems set to true (see below), so if the other party does not pad using the default padding (whatever that is, probably PKCS#7 padding), then the result should fail…

    decipher.setAutoPadding(auto_padding=true)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using node.js in my server side. Now I wanna run some binary file
I'm working on uploading file encrypted on the client side using Node.js, and I
I'm using Node.js and I want to see all of the parameters that have
I am using Node.js and Mongoose to store some data. After update, I have
I have been using node and redis for some time. The problem I am
I am using node-fluent-ffmpeg module in NodeJS. It is very good that fluent-ffmpeg provides
I'm using Node.js and trying to render an EJS template file. I figured out
I'm using Node.js + Express + nodejs-sqlite3 to make a form that when submited
I am using node.js for my application and I have to do user authentication
I am trying to generate a digital signature using the crypto module for node.js

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.