Closed seeifsalem closed 1 year ago
Why don't you make a your own printer function and use it during encryption?
Why don't you make a your own printer function and use it during encryption?
But how would I know what is the expected result ?
You can use an external tool like xxd
I don't understand how it would make sense for me to have the same two last characters ("wu") but having a mistake in the middle. We are using CBC so the encryption depends on the previously encoded block. If any of my encoded blocks was wrong, then the last encoded blocks can't be correct.
You may catch the concept of enc/dec, but your implementation might have a bug. Please debug your code carefully.
@seeifsalem Have you checked if the expected file and your output have the same size?
@seeifsalem Have you checked if the expected file and your output have the same size?
how would I check that ? I mean it seems to me that they have the same number of characters
Redirect your output from encrypting to another file like this:
./aes enc test/key.txt test/iv.txt test/helloworld.txt > test/helloworld.output
and compare the file sizes of helloworld.expected
and helloworld.output
.
Or, you can just use wc
:
./aes enc test/key.txt test/iv.txt test/helloworld.txt | wc -c
This will count the number of characters. The expected value is 13 for helloworld.
Redirect your output from encrypting to another file like this:
./aes enc test/key.txt test/iv.txt test/helloworld.txt > test/helloworld.output
and compare the file sizes of
helloworld.expected
andhelloworld.output
.Or, you can just use
wc
:./aes enc test/key.txt test/iv.txt test/helloworld.txt | wc -c
This will count the number of characters. The expected value is 13 for helloworld.
I just checked, I have the same number of characters but I think I solved my problem.
Name: Mohamed Seifeddine Salem
Hello, I am having a hard time debugging the CBC encryption because this is what I stumble upon is there any way to obtain the actual characters instead of these ���� ?