vsklad / cgen

CGen is a tool for encoding SHA-1 and SHA-256 hash functions into CNF in DIMACS format, also into ANF polynominal system in PolyBoRi output format.
https://cgen.sophisticatedways.net
MIT License
22 stars 6 forks source link

Hash and message doesn’t match after solving the generated instance #5

Closed ImposterMido closed 8 months ago

ImposterMido commented 9 months ago

First of all sorry of inconvenience and hope you could help me I have encoded a sha256 instance with no M or H assigned then solved it , i took the 1st 512 variables (M) then convert it to binary by taking true variables as 1 and false as 0 then used the 512 bits as input for an online sha256 then took the resultant output in hex and converted it to binary and when i compared it to the variables contribute to H it doesn't match although it must match as the message is fixed , also i tried to convert message into text or hex but both give hash doesn't match the real hash any ideas to solve this problem ?

ImposterMido commented 9 months ago

Is this due to an error i have done during the getting M and H or is there a certain way to get the message and hash that accurately match the normal sha256 encoding ?

vsklad commented 9 months ago

please kindly provide the message and the hash value, I will look into it it is supposed to match of course also, when assigning or interpreting variables please note the ordering is big endian

ImposterMido commented 9 months ago

Hello sir t i have solved the instance by cryptominisat and collected the message and has from variables then tried to compute it , i would send text file contain the instance and the solution file to check and also tell me if i am doing something wrong and show me accurate steps !

On Monday, 9 October 2023, vsklad @.***> wrote:

please kindly provide the message and the hash value, I will look into it it is supposed to match of course also, when assigning or interpreting variables please note the ordering is big endian

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1752825883, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2VEU5H2T4JHN4G272LX6PNI3AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSHAZDKOBYGM . You are receiving this because you authored the thread.Message ID: @.***>

ImposterMido commented 9 months ago

sorry for being late here are the instance without m or h assigned and the solution generated by cryptominisat could you double check please and tell me if i am wrong and if so show the exact steps to achieve reliable results as you would generate

On Mon, 9 Oct 2023 at 16:13, mido hossam @.***> wrote:

Hello sir t i have solved the instance by cryptominisat and collected the message and has from variables then tried to compute it , i would send text file contain the instance and the solution file to check and also tell me if i am doing something wrong and show me accurate steps !

On Monday, 9 October 2023, vsklad @.***> wrote:

please kindly provide the message and the hash value, I will look into it it is supposed to match of course also, when assigning or interpreting variables please note the ordering is big endian

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1752825883, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2VEU5H2T4JHN4G272LX6PNI3AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSHAZDKOBYGM . You are receiving this because you authored the thread.Message ID: @.***>

vsklad commented 9 months ago

please note there is no attachment with the last message please kindly attach/specify: 1) the instance itself that you are trying to solve 2) the intended message/hash values 3) the bits of the instance (message/hash) that you are trying to assign before solving 4) the solution produced by the solver

ImposterMido commented 9 months ago

Kindly double check as it appears to me that zipped folder named instance and solution is already sent , the instance is without hash or message assigned , the solution contains variables values , when trying to get the first 512 bits (M) and convert it to hex then apply sha256 from external source , the variables contribute to hash in the solution file doesnt match with it !

On Tuesday, 10 October 2023, vsklad @.***> wrote:

please note there is no attachment with the last message please kindly attach/specify:

  1. the instance itself that you are trying to solve
  2. the intended message/hash values
  3. the bits of the instance (message/hash) that you are trying to assign before solving
  4. the solution produced by the solver

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1756054419, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2SSQBNPYPDXC43XMWLX6WK67AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGA2TINBRHE . You are receiving this because you authored the thread.Message ID: @.***>

ImposterMido commented 9 months ago

I have sent it again to make sure it reaches you !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

Kindly double check as it appears to me that zipped folder named instance and solution is already sent , the instance is without hash or message assigned , the solution contains variables values , when trying to get the first 512 bits (M) and convert it to hex then apply sha256 from external source , the variables contribute to hash in the solution file doesnt match with it !

On Tuesday, 10 October 2023, vsklad @.***> wrote:

please note there is no attachment with the last message please kindly attach/specify:

  1. the instance itself that you are trying to solve
  2. the intended message/hash values
  3. the bits of the instance (message/hash) that you are trying to assign before solving
  4. the solution produced by the solver

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1756054419, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2SSQBNPYPDXC43XMWLX6WK67AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGA2TINBRHE . You are receiving this because you authored the thread.Message ID: @.***>

ImposterMido commented 9 months ago

Just in case it doesnt reach you could you please explain to me exactly in details how to convert the bits of message and hash from the solution of the instance in terms of conversion till reach the text represent message and hash !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

I have sent it again to make sure it reaches you !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

Kindly double check as it appears to me that zipped folder named instance and solution is already sent , the instance is without hash or message assigned , the solution contains variables values , when trying to get the first 512 bits (M) and convert it to hex then apply sha256 from external source , the variables contribute to hash in the solution file doesnt match with it !

On Tuesday, 10 October 2023, vsklad @.***> wrote:

please note there is no attachment with the last message please kindly attach/specify:

  1. the instance itself that you are trying to solve
  2. the intended message/hash values
  3. the bits of the instance (message/hash) that you are trying to assign before solving
  4. the solution produced by the solver

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1756054419, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2SSQBNPYPDXC43XMWLX6WK67AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGA2TINBRHE . You are receiving this because you authored the thread.Message ID: @.***>

ImposterMido commented 9 months ago

Hello sir , i have tried what you said exactly create an instance with 512 bits message and used padding and havent encoded any M or H and tried to solved it , it seems harder but when solved i tried to convert message bits into hash using sha256 tool then when comparing binary bits of H in the solution of instance with the hash already got from sha256 tool based on the M bits it didnt also match i want to know where does the problem lie in ? Could you please help me i will send the problem and its solution so you could do your steps yo check if i am right or i am doing something wrong so you tell me the exact steps to get them match !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

Just in case it doesnt reach you could you please explain to me exactly in details how to convert the bits of message and hash from the solution of the instance in terms of conversion till reach the text represent message and hash !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

I have sent it again to make sure it reaches you !

On Tuesday, 10 October 2023, mido hossam @.***> wrote:

Kindly double check as it appears to me that zipped folder named instance and solution is already sent , the instance is without hash or message assigned , the solution contains variables values , when trying to get the first 512 bits (M) and convert it to hex then apply sha256 from external source , the variables contribute to hash in the solution file doesnt match with it !

On Tuesday, 10 October 2023, vsklad @.***> wrote:

please note there is no attachment with the last message please kindly attach/specify:

  1. the instance itself that you are trying to solve
  2. the intended message/hash values
  3. the bits of the instance (message/hash) that you are trying to assign before solving
  4. the solution produced by the solver

— Reply to this email directly, view it on GitHub https://github.com/vsklad/cgen/issues/5#issuecomment-1756054419, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6GHT2SSQBNPYPDXC43XMWLX6WK67AVCNFSM6AAAAAA5XAR5ACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJWGA2TINBRHE . You are receiving this because you authored the thread.Message ID: @.***>