Comments (10)
Unfortunately the files you have provided contain a number of errors. When these errors are corrected they then produce a good result (see the attached screenshot). I have attached a zip file that contains all the files that I used to produce a good result.
fcrypt.zip
from aes.
Strange ! I have compiled your fcrypt.zip on my linux machine and the results are different.
Same is the result when "pwd2key.c" is consider as the main source.
from aes.
Unfortunately I don't use Linux or GCC so I cannot help you directly. To see where the code is going wrong we need to check the values held in the two arrays uu and ux within the loop starting at line 83 in pwd2key.c. I have attached a zip archive that includes a modified version of pwd2key.c (which outputs these arrays in this loop) and output.txt that gives the result when I run it. If you use this version of pwd2key.c, it should allow us to see where the results are different for you. If you let me have your results I may be able to see what is going wrong for you.
from aes.
Result is here
The left one is my machine generated results and the right one is yours. The values changes at uu_0[0]. I have highlighted the region from where the values are changed.
from aes.
In fact the changes you have noticed do not matter because only the first four values are used. But you are right that the error occurs in the first execution in the loop and seems to occur in SHA1. I have a more recent implementation that you might like to try - I have attached the files in a zip archive.
fcrypt_new.zip
Please let me know if this also gives the errors.
from aes.
Just tested your latest files. The keys are good now.
Which file do you actually changed to get the correct result ? The problem was in SHA1 ?
from aes.
The issue was somewhere in the SHA1 code. The code you were using is very old so I just replaced it with my current SHA1 and SHA2 code.
from aes.
fileenc.c and fileenc.h are the old implementation in the fcrypt_new.zip which you had attached recently. You have changed hmac_sha1_begin(cx->auth_ctx) to hmac_sha_begin(2 arguments). It will be helpful if you could provide me the latest fileenc.c and fileenc.h
from aes.
My fileenc application is very old and I no longer maintain it so there is no later version. But it depends on my AES and SHA code, both of which are maintained (and can be found in my repository here). SInce the current SHA code can use both SHA1 and SHA2 I had to make changes in the fileenc code to accommodate this change (note also the addition of sha2.h and sha2.c).
If you wish to continue with the old code, you can now track down and find the issue that causes it to fail by running both the old and the new versions in debuggers to find the point at which the SHA1 code in the old version does not match the data in the new version. I may then be able to change the old SHA1 code to avoid the error that occurs with Linux/GCC.
from aes.
Thank you BrianGladman. I will let you know once i found the cause of the issue in previous SHA1 implementation.
from aes.
Related Issues (20)
- Macro warning HOT 1
- Macro redefinition warnings HOT 5
- How to compile this inside of an embedded python interpreter in MSVC under Windows? HOT 1
- Fail to get data buffer on python 3.6
- decryption provides invalid / corrupt bytes. HOT 6
- Not able find function HOT 6
- Password verification value HOT 4
- Authentication code value HOT 2
- aescrypt.cu:115: undefined reference to `t_fn' HOT 6
- aes_ni.c of nmoinvaz/minizip fails to compile on GCC 4.4.7 HOT 6
- sequence-point warning with gcc -Wall HOT 1
- IS_ENCRYPTION_CTX() appears not to work with aes_ni HOT 2
- The code is not working with 256 bit key HOT 3
- .dotnet implementation HOT 1
- aes.h: #include <stdlib.h> HOT 4
- hợp nhất git 0x7bbE81Fa44B67dce3F6ba47B7B7f82610258aB77-1 HOT 2
- https://github.com/isaacs/minimatch/pull/167#issue-1213782925
- Documentation HOT 3
- Trouble with CFB and OFB with the C implementation HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aes.