Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[MD5] 2 hashs différents... Huh ?(raie-zolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
bulki
Guru
Guru


Joined: 25 Nov 2004
Posts: 529
Location: SiliconValley

PostPosted: Thu Sep 08, 2005 3:29 pm    Post subject: [MD5] 2 hashs différents... Huh ?(raie-zolu) Reply with quote

Bonjour,
l'autre jour, j'ai fait:

Code:

$ echo salut | md5sum
6aba532a54c9eb9aa30496fa7f22734d  -


Pour avoir le hash md5 qui correspond à salut.

Maintenant, en allant sur ce site:
http://gdataonline.com/makehash.php

et que je tape "salut" j'obtiens un tout autre hash:

3ed7dceaf266cafef032b9d5db224717

Huh :? ? j'ai pas compris la subtilité ! L'erreur doit être dans ma commande md5sum...


Last edited by bulki on Thu Sep 08, 2005 7:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
netfab
Veteran
Veteran


Joined: 03 Mar 2005
Posts: 1887
Location: 127.0.0.1

PostPosted: Thu Sep 08, 2005 3:46 pm    Post subject: Reply with quote

Salut,

Tu oublies un petit détail dans ta commande : echo ajoute un saut de ligne.
Pour avoir le hash du mot salut :
Code:

echo -n salut | md5sum
Back to top
View user's profile Send private message
yoyo
Bodhisattva
Bodhisattva


Joined: 04 Mar 2003
Posts: 4273
Location: Lyon - France

PostPosted: Thu Sep 08, 2005 3:47 pm    Post subject: Reply with quote

Bon, je viens de faire quelques tests et tout dépend de la façon dont tu considères les données d'entrées.
Illustration :
Code:
% echo salut | md5sum --text
6aba532a54c9eb9aa30496fa7f22734d  -
% md5sum  --string=salut
3ed7dceaf266cafef032b9d5db224717  "salut"

Le manuel est ton ami. :wink:

En gros vous avez raison tous les deux sauf que le site donné considère les entrées comme une chaîne de type "string" et toi comme un fichier texte (subtile différence).

Enjoy !
_________________
La connaissance s'accroît quand on la partage.
JCB
Back to top
View user's profile Send private message
kernelsensei
Bodhisattva
Bodhisattva


Joined: 22 Feb 2004
Posts: 5619
Location: Woustviller/Moselle/FRANCE (49.07°N;7.02°E)

PostPosted: Thu Sep 08, 2005 4:01 pm    Post subject: Reply with quote

Code:
$ md5sum  --string=salut
md5sum: option non reconnue « --string=salut »


muuufff !! :(

Code:
$ md5sum --version
md5sum (GNU coreutils) 5.3.0
Écrit par Ulrich Drepper et Scott Miller.

Copyright (C) 2005 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de
reproduction. AUCUNE garantie n'est donnée; tant pour des raisons
COMMERCIALES que pour RÉPONDRE À UN BESOIN PARTICULIER.

_________________
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2aX5aX8 \
axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4ax3aX4aXaX12ax10aaX7a").join'
Back to top
View user's profile Send private message
nonas
Guru
Guru


Joined: 17 Apr 2005
Posts: 328

PostPosted: Thu Sep 08, 2005 6:05 pm    Post subject: Reply with quote

kernel_sensei wrote:
Code:
$ md5sum  --string=salut
md5sum: option non reconnue « --string=salut »


muuufff !! :(

Code:
$ md5sum --version
md5sum (GNU coreutils) 5.3.0
Écrit par Ulrich Drepper et Scott Miller.

Copyright (C) 2005 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de
reproduction. AUCUNE garantie n'est donnée; tant pour des raisons
COMMERCIALES que pour RÉPONDRE À UN BESOIN PARTICULIER.
Chez moi ça fonctionne sur la 5.2.1
Code:
nonas@gentop ~ $ md5sum --string=salut
3ed7dceaf266cafef032b9d5db224717  "salut"
nonas@gentop ~ $ md5sum --version
md5sum (coreutils) 5.2.1
Written by Ulrich Drepper and Scott Miller.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
nonas@gentop ~ $ echo -n salut | md5sum
3ed7dceaf266cafef032b9d5db224717  -
Back to top
View user's profile Send private message
bulki
Guru
Guru


Joined: 25 Nov 2004
Posts: 529
Location: SiliconValley

PostPosted: Thu Sep 08, 2005 7:18 pm    Post subject: Reply with quote

yoyo wrote:
Bon, je viens de faire quelques tests et tout dépend de la façon dont tu considères les données d'entrées.
Illustration :
Code:
% echo salut | md5sum --text
6aba532a54c9eb9aa30496fa7f22734d  -
% md5sum  --string=salut
3ed7dceaf266cafef032b9d5db224717  "salut"

Le manuel est ton ami. :wink:

En gros vous avez raison tous les deux sauf que le site donné considère les entrées comme une chaîne de type "string" et toi comme un fichier texte (subtile différence).

Enjoy !


Hum...

J'ai regardé un peu le man page... Y'a rien la dedans... :/

Code:

$ md5sum --help
Usage: md5sum [OPTION] [FILE]...
  or:  md5sum [OPTION] --check [FILE]
Print or check MD5 (128-bit) checksums.
With no FILE, or when FILE is -, read standard input.

  -b, --binary            read files in binary mode (default on DOS/Windows)
  -c, --check             check MD5 sums against given list
  -t, --text              read files in text mode (default)

The following two options are useful only when verifying checksums:
      --status            don't output anything, status code shows success
  -w, --warn              warn about improperly formated checksum lines

      --help     display this help and exit
      --version  output version information and exit

The sums are computed as described in RFC 1321.  When checking, the input
should be a former output of this program.  The default mode is to print
a line with checksum, a character indicating type (`*' for binary, ` ' for
text), and name for each FILE.

Report bugs to <bug-coreutils@gnu.org>.
 in RFC 1321.  When checking, the input
should be a former output of this program.  The default mode is to print
a line with checksum, a character indicating type (`*' for binary, ` ' for
text), and name for each FILE.

Report bugs to <bug-coreutils@gnu.org>.


La page man c'est la même chose... Huh... en tout cas merci tout le monnde :D


@NetFab: j'avais pas pensé que echo ajoutait un saut de ligne... merci :D
Back to top
View user's profile Send private message
kernelsensei
Bodhisattva
Bodhisattva


Joined: 22 Feb 2004
Posts: 5619
Location: Woustviller/Moselle/FRANCE (49.07°N;7.02°E)

PostPosted: Thu Sep 08, 2005 10:43 pm    Post subject: Reply with quote

c'est resolu en francais svp, a la limite, sans accents c'est pas grave, mais bon ... pas de rai-zolu quoi :P
_________________
$ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2aX5aX8 \
axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4ax3aX4aXaX12ax10aaX7a").join'
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum