D
D
doev032022-02-22 12:37:54
Encryption
doev03, 2022-02-22 12:37:54

How to find out how a string is encrypted, knowing the key and what is encrypted in it?

Good afternoon, I want to ask you for help with the definition of tools / encryption method, with the following initial data:

Key: e9644439636b8e794ff8c82293bf182c

encrypted string: b4944857e699c8778fd432274ec04ca313e65a099122719f3791b0a39d06687f2c3806303e2982e5f8f22b7bf080e4713ad67489c4462e49cd8de73a708c0c82cf7392f8ed7f94368ad017715b2355fdb20750d751e3d481f4e23f47234db29d91df988418c326b315b4166ab07e04ece57e39896544c4600ad07fb8695b85f42609cc0a8ca5dd40abb884278bbb722a

Decoded line: https: //upload.ton.place/uploads/videos/tmp/91ee57 ...
(not the video is encrypted, but the link-string itself)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael, 2022-02-22
@Akela_wolf

First, "decrypted string" returns 404.
Secondly, is the decrypted string a video file? In this case, I will disappoint you - this is not encryption, this is hashing. But then I did not understand what the "key" had to do with it.
Hashing differs from encryption in that hashing is irreversible, that is, it is impossible to get the original file from the hash.
You can determine the algorithm only by brute force - take known hashing algorithms, some can be immediately discarded as unsuitable (for example, MD5, SHA-128 - the hash length is too large). And then sort through.
But in your case, the length is 106 characters, that's 424 bits - something non-standard, it seems. Or maybe you misunderstood the problem.

M
MaxKozlov, 2022-02-22
@MaxKozlov

Here is a stub based on https://www.php.net/manual/en/function.hash.php#104987
But in this form there are not even partial matches.
Considering that, as they wrote in the comments, there is clearly not a pure algorithm, but a combination, for example, of a salt and a hash, you can experiment until you are blue in the face. there can also be both a banal xor and a combination of all sorts of permutations of different algorithms and salts

<?php
$data = "https://upload.ton.place/uploads/videos/tmp/91ee572b-cd30-4209-5651-7e049c155529.mp4";
print("HASH\n");
foreach (hash_algos() as $v) {
        $r = hash($v, $data, false);
        printf("%-12s %3d %s\n", $v, strlen($r), $r);
}

$key = hex2bin('e9644439636b8e794ff8c82293bf182c');
print("HMAC\n");
foreach (hash_hmac_algos() as $v) {
        $r = hash_hmac($v, $data, $key, false);
        printf("%-12s %3d %s\n", $v, strlen($r), $r);
}
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question