Score:0

tan(x) as a hash function

mq flag
print(tan(int.from_bytes(open("plain.txt", "rb").read().strip(), "big")).n(1024))

Its sage code. How difficult or easy is it to recover the plaintext from the output of this code? I don't think the hash collision, or second preimage attack will be usefully unless we know the length of the plaintext.

Is there any possible way to recover the plaintext efficiently or is there no other way?

Maarten Bodewes avatar
in flag
Why don't you think hash collision isn't useful? The point of cryptographic hash functions is that the output of the hash function *isn't related* to the output of a similar input, otherwise you can *converge on the output*.
crypto_lover avatar
mq flag
I meant not efficient. It will be difficult finding a hash collision. I am Looking for something like a weakness or bad implementation that will allow us to find the plain text in reasonable time like 1 or 2 mins max for a high end normal pc. I wanted to know if something like finding the preimage is possible from the output. If i know the plain text starts with `hello` and ends with `world.` then is it possible to find using any method or attack?
Maarten Bodewes avatar
in flag
You can converge in milliseconds, if that. I assume you got that due to the deletion... It is no problem leaving your question or to self answer.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.