AES encrypted characters are not reading properly

Sarath Govind 1 Reputation point
2021-07-19T07:21:56.48+00:00

I have an application which does encryption , the library which I used is bcrypt.h . After the encryption, I'll be saving this cipher text to a file. A part of the cipher text look like this

1]Ž�làk¨äéôòÝ´?ØíEçùdª9øÎCÈÎýéqÌH8ÃÇ›}coD#y“¡7”

The problem is that , when I'm reading this cipher text for decryption , the entire cipher text string is not reading properly .
Please suggest me some method for reading this encrypted test

I've tried _wfopen_s() method and ifstream() etc.

The application is written in c++

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,615 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,724 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 117.3K Reputation points
    2021-07-19T07:53:48.697+00:00

    Use _wfopen_s and specify "b" for the third (mode) argument (for both of writing and reading procedures).

    If still does not work, show more details, or maybe prepare a simple project that demonstrates the issue (on OneDrive, etc.).


  2. Sarath Govind 1 Reputation point
    2021-07-19T12:00:38.257+00:00

    update

    tried converting encrypt text to hex . But while reading the hex , string variable doesn't hold the whole text


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.