K
K
kharisergey2016-05-27 11:09:08
PHP
kharisergey, 2016-05-27 11:09:08

How to sign a file according to GOST 34.11-94 in Laravel?

Hello.
In a Laravel 5 project, files of various formats (PDF, DOCx, etc.) are dynamically generated and saved to a folder on the server. Now it is required to calculate the hashes of all saved files and display them in a table along with the file names. Hashes need to be calculated according to the GOST 34.11-94 algorithm, and this is the problem. How to do it beautifully in Laravel?
By MD5, SHA, etc. there are standard beautiful solutions like: php.net/manual/en/function.sha1-file.php
string sha1_file ( string $filename [, bool $raw_output = false ] )
And what about GOST?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-05-27
Protko @Fesor

Use openssl. Everything is there, though I offer you the current version: https://rt.openssl.org/Ticket/Display.html?id=3311...

D
D', 2016-05-27
@Denormalization

Write an implementation of the hash function and use it.
What answer do you expect? Google "php GOST 34.11-94" for you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question