Prezados, tud bem?

Bem, estou estudando segurança em TI e um tópico é de encriptação e ao usar o SHA para encriptar um arquivo me retorna este erro. Não estou como root, assim como não estava nos outros tópicos. Estou usando a sincronia com um laboratório no qwiklabs. Em fim como o SHA me retorna este erro:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_MEASUREMENT = “pt_BR.UTF-8”,
LC_PAPER = “pt_BR.UTF-8”,
LC_MONETARY = “pt_BR.UTF-8”,
LC_NUMERIC = “pt_BR.UTF-8”,
LC_TIME = “pt_BR.UTF-8”,
LANG = “en_US.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to a fallback locale (“en_US.UTF-8”).
Value “file.txt” invalid for option a (number expected)
Type shasum -h for help

podem me ajudar?
Obrigado

Hi, i don’t think that your problem is related to Endless OS, as the system wide Perl installation supports the SHA family of Hashing Algorithms. Take this example:

#!/usr/bin/perl
use Digest::SHA qw(sha256_hex);
print sha256_hex('Hello, World!'), "\n";

will print out the hex-encoded hash of the given String. If the above does not work for you, please give use some more information:

  1. Which Endless OS Version
  2. The sourcecode in question which produces the issue

hello, thanks for replying!

Well the version of Endless that I use is 3

the return if when I give the command:

shasum file.txt> file.txt.sha1

I did the same process for md5 and returns the desired one.

Well yes, the issue here is, that there are variants of SHA (SHA-1, SHA-256, SHA-512, …), so you need to execute one of the following commands to calculate the Hash of a file with the corresponding Algorithm:

sha1sum
sha224sum
sha256sum
sha384sum
sha512sum

Nowadays, the most common used ones are sha256sum and sha512sum. The command shasum exists, but it’s not a binary, it’s a shell-wrapper around one of the above mentioned tools.

Algo que nos ajudaria bastante a entender o problema seria o seguinte:

  1. Abra o aplicativo chamado ‘Terminal’
  2. Neste aplicativo execute o comando:

eos-diagnostics

  1. O comando acima irá criar um arquivo com as informações do seu sistema (exemplo: eos-diagnostic-160614_111731_UTC+0100.txt); Nos envie esse arquivo para que possamos analisar e ver uma possível solução

Olá, obrigado por responder!

gerou um texto extenso, no caso o que observar?

eos-diagnostic-201010_104029_UTC-0300.txt (965,5,KB)

Hello, you fine?

thanks for answering!

then it would look like this:
sha1sum file.txt> file.txt.sha1?

Hello, thanks for answering!

so for this detail is not equal to md5?

good weekend!

Hello, Thanks for answering!

in the course they typed shasum and as I didn’t know I typed the same and it gave an error. I did what you said, in the sha1sum case and it worked