iagox86 / hash_extender Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Assumed we just need to run make. Got this error at the start of the process.
$ make
uname: illegal option -- o
usage: uname [-amnprsv]
[CC] buffer.o
In file included from :162:
:2:9: error: macro names must be identifiers
^
1 error generated.
make: *** [buffer.o] Error 1
As you can see, just using the make that comes with Apple.
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
➜ hash_extender ./hash_extender --data data --secret 6 --append append --signature 6036708eba0d11f6ef52ad44e8b74d5b --format sha256
hash_extender: Couldn't parse argument
this is the output im getting when running the readme example...
additionally the selftest segfaults:
➜ hash_extender ./hash_extender_test
md4: Testing some basic hash data...
md4: Testing hash data of various lengths...
md5: Testing some basic hash data...
md5: Testing hash data of various lengths...
ripemd160: Testing some basic hash data...
ripemd160: Testing hash data of various lengths...
sha: Testing some basic hash data...
sha: Testing hash data of various lengths...
sha1: Testing some basic hash data...
sha1: Testing hash data of various lengths...
sha256: Testing some basic hash data...
sha256: Testing hash data of various lengths...
sha512: Testing some basic hash data...
sha512: Testing hash data of various lengths...
sm3: Testing some basic hash data...
[1] 72710 segmentation fault (core dumped) ./hash_extender_test
running on arm ubuntu 22.04 vm on arm mac m2
it shows deprecated
NixOS now builds all packages with -D_FORTIFY_SOURCE=3
. This causes the hash_extender --test
mode to fail with *** buffer overflow detected ***: terminated
. This is on x86_64 linux using gcc 12.
See full build log @ https://hydra.nixos.org/log/ilpbzm1cw05p7z10ma5zlrxdgx4s2kc1-hash_extender-unstable-2020-03-24.drv (mirror @ https://gist.github.com/risicle/2a24820ff99ea7d63b8cc5f1215f4027)
This error occurs after the launch in normal mode and after: ./hash_extender --test
How did we calculate the original hash 6036708eba0d11f6ef52ad44e8b74d5b? I am getting a different hash value when i use hash_extension_1.c to calculate H(secret||data) . Would be happy if you could answer this.
➜ hash_extender git:(master) ✗ make
[CC] buffer.o
[CC] formats.o
[CC] hash_extender.o
[CC] hash_extender_engine.o
[CC] test.o
[CC] util.o
[LD] hash_extender
Undefined symbols for architecture x86_64:
"_WHIRLPOOL_Final", referenced from:
_whirlpool_hash in hash_extender_engine.o
"_WHIRLPOOL_Init", referenced from:
_whirlpool_hash in hash_extender_engine.o
"_WHIRLPOOL_Update", referenced from:
_whirlpool_hash in hash_extender_engine.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hash_extender] Error 1
how can I fix it
when i try to make,got a problem like this
ash_extender_engine.c: In function ‘md4_hash’: hash_extender_engine.c:362:3: error: ‘MD4_Init’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 362 | MD4_Init(&c); | ^~~~~~~~ In file included from hash_extender_engine.c:26: /usr/include/openssl/md4.h:50:27: note: declared here 50 | OSSL_DEPRECATEDIN_3_0 int MD4_Init(MD4_CTX *c); | ^~~~~~~~ hash_extender_engine.c:367:7: error: ‘MD4_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 367 | MD4_Update(&c, "A", 1); | ^~~~~~~~~~ In file included from hash_extender_engine.c:26: /usr/include/openssl/md4.h:51:27: note: declared here 51 | OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len); | ^~~~~~~~~~ hash_extender_engine.c:375:3: error: ‘MD4_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 375 | MD4_Update(&c, data, length); | ^~~~~~~~~~ In file included from hash_extender_engine.c:26: /usr/include/openssl/md4.h:51:27: note: declared here 51 | OSSL_DEPRECATEDIN_3_0 int MD4_Update(MD4_CTX *c, const void *data, size_t len); | ^~~~~~~~~~ hash_extender_engine.c:376:3: error: ‘MD4_Final’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 376 | MD4_Final(buffer, &c); | ^~~~~~~~~
how to solve this?
Getting the following error:
$ make
[CC] formats.o
<command-line>: error: missing whitespace after the macro name
In file included from test.h:4,
from formats.c:4:
util.h:4:17: error: err.h: No such file or directory
make: *** [Makefile:39: formats.o] Error 1
Any pointers what should I do?
Thanks.
According to Wikipedia, the cryptographic hash function used in the Chinese National Standard uses Merkle-Damgård construction. Therefore, the algorithm is vulnerable to length extension attacks.
Would you like to support it?
Could you add support of Tiger-192 / haval192 which seems to be affected by this attack ?
in your text you say
Knowing only data, H, and signature, the attacker's goal is to append 'append' to data and generate a valid signature for the new data. And that's easy to do! Let's see how.
but actually, you need the length of secret
to calculate the length of padding?
Hi
Compilation by "make" worked first time on old Kali, having issues with later Kali (2016.2). First I got:
hash_extender_engine.c:25:25: fatal error: openssl/md4.h: No such file or directory
I solved this by locating md4.h and added a -I/path/to/file in the CPPFLAGS of the Makefile. Next I got:
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
I found a ssl.so and crypto.so in different and pretty random-looking places. But I went ahead and added -L/path/to/file (twice to cover both files) in the LDFLAGS of the Makefile. But no joy.
Needless to say my make/gcc skills aren't great so help appreciated where Google is letting me down.
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.