Spec-Zone .ru
спецификации, руководства, описания, API
Spec-Zone .ru
спецификации, руководства, описания, API
Библиотека разработчика Mac Разработчик
Поиск

 

Эта страница руководства для  версии 10.9 Mac OS X

Если Вы выполняете различную версию  Mac OS X, просматриваете документацию локально:

Читать страницы руководства

Страницы руководства предназначаются как справочник для людей, уже понимающих технологию.

  • Чтобы изучить, как руководство организовано или узнать о синтаксисе команды, прочитайте страницу руководства для страниц справочника (5).

  • Для получения дополнительной информации об этой технологии, ищите другую документацию в Библиотеке Разработчика Apple.

  • Для получения общей информации о записи сценариев оболочки, считайте Shell, Пишущий сценарий Учебника для начинающих.



ripemd160(n)                           RIPEMD Message-Digest Algorithm                          ripemd160(n)



____________________________________________________________________________________________________________

NAME
       ripemd160 - RIPEMD-160 Message-Digest Algorithm

SYNOPSIS
       package require Tcl  8.2

       package require ripemd160  ?1.0.3?

       ::ripemd::ripemd160 ?-hex? [ -channel channel | -file filename | string ]

       ::ripemd::hmac160 ?-hex? -key key [ -channel channel | -file filename | string ]

       ::ripemd::RIPEMD160Init

       ::ripemd::RIPEMD160Update token data

       ::ripemd::RIPEMD160Final token

       ::ripemd::RIPEHMAC160Init key

       ::ripemd::RIPEHMAC160Update token data

       ::ripemd::RIPEHMAC160Final token

____________________________________________________________________________________________________________

DESCRIPTION
       This  package  is an implementation in Tcl of the RIPEMD-160 message-digest algorithm (1). This algo-rithm algorithm
       rithm takes an arbitrary quantity of data and generates a 160-bit message digest from the input.  The
       RIPEMD-160  algorithm is based upon the MD4 algorithm (2, 4) but has been cryptographically strength-ened strengthened
       ened against weaknesses that have been found in MD4 (4).

       This package will use cryptkit or Trf to accelerate the  digest  computation  if  either  package  is
       available. In the absence of an accelerator package the pure-Tcl implementation will be used.

COMMANDS
       ::ripemd::ripemd160 ?-hex? [ -channel channel | -file filename | string ]
              Calculate  the  RIPEMD-160  digest  of  the data given in string. This is returned as a binary
              string by default. Giving the -hex option will return a hexadecimal  encoded  version  of  the
              digest.

              The  data  to be hashed can be specified either as a string argument to the ripemd160 command,
              or as a filename or a pre-opened channel. If the -filename argument is given then the file  is
              opened,  the  data  read  and hashed and the file is closed. If the -channel argument is given
              then data is read from the channel until the end of file. The channel is not closed.

              Only one of -file, -channel or string should be given.

       ::ripemd::hmac160 ?-hex? -key key [ -channel channel | -file filename | string ]
              Calculate an Hashed Message Authentication digest (HMAC) using  the  RIPEMD-160  digest  algo-rithm. algorithm.
              rithm.  HMACs  are  described  in RFC 2104 (5) and provide a RIPEMD-160 digest that includes a
              key. All options other than -key are as for the ::ripemd::ripemd160 command.


PROGRAMMING INTERFACE
       For the programmer, hash functions can be viewed as a bucket into which one pours data. When you have
       finished, you extract a value that is uniquely derived from the data that was poured into the bucket.
       The programming interface to the hash operates on a  token  (equivalent  to  the  bucket).  You  call
       RIPEMD160Init  to  obtain a token and then call RIPEMD160Update as many times as required to add data
       to the hash. To release any resources and obtain the hash value, you  then  call  RIPEMD160Final.  An
       equivalent set of functions gives you a keyed digest (HMAC).

       ::ripemd::RIPEMD160Init
              Begins  a  new  RIPEMD-160  hash. Returns a token ID that must be used for the remaining func-tions. functions.
              tions.

       ::ripemd::RIPEMD160Update token data
              Add data to the hash identified by token. Calling RIPEMD16_Update $token "abcd" is  equivalent
              to  calling RIPEMD16_Update $token "ab" followed by RIPEMD16_Update $token "cb". See EXAMPLES.

       ::ripemd::RIPEMD160Final token
              Returns the hash value and releases any resources held by this token. Once this  command  com-pletes completes
              pletes  the  token will be invalid. The result is a binary string of 16 bytes representing the
              160 bit RIPEMD-160 digest value.

       ::ripemd::RIPEHMAC160Init key
              This is equivalent to the ::ripemd::RIPEMD160Init command except that it requires the key that
              will be included in the HMAC.

       ::ripemd::RIPEHMAC160Update token data

       ::ripemd::RIPEHMAC160Final token
              These commands are identical to the RIPEMD160 equivalent commands.


EXAMPLES
       % ripemd::ripemd160 -hex "Tcl does RIPEMD-160"
       0829dea75a1a7074c702896723fe37763481a0a7


       % ripemd::hmac160 -hex -key Sekret "Tcl does RIPEMD-160"
       bf0c927231733686731dddb470b64a9c23f7f53b


       % set tok [ripemd::RIPEMD160Init]
       ::ripemd::1
       % ripemd::RIPEMD160Update $tok "Tcl "
       % ripemd::RIPEMD160Update $tok "does "
       % ripemd::RIPEMD160Update $tok "RIPEMD-160"
       % ripemd::Hex [ripemd::RIPEMD160Final $tok]
       0829dea75a1a7074c702896723fe37763481a0a7


REFERENCES
       [1]    H.  Dobbertin,  A.  Bosselaers,  B.  Preneel,  "RIPEMD-160,  a strengthened version of RIPEMD"
              http://www.esat.kuleuven.ac.be/~cosicart/pdf/AB-96_1/AB-96_1.pdf

       [2]    Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT,  April  1992.  (http://www .rfc-
              editor.org/rfc/rfc132_.txt

       [3]    Rivest,  R.,  "The MD4 message digest algorithm", in A.J.  Menezes and S.A. Vanstone, editors,
              Advances in Cryptology - CRYPTO '90 Proceedings, pages 303-311, Springer-Verlag, 1991.

       [4]    Dobbertin, H., "Cryptanalysis of MD4", Journal of Cryptology vol 11 (4), pp. 253-271 (1998)

       [5]    Krawczyk, H., Bellare, M. and Canetti, R. "HMAC: Keyed-Hashing  for  Message  Authentication",
              RFC 2104, February 1997.  (http://www.rfc-editor.org/rfc/rfc21_4.txt)


BUGS, IDEAS, FEEDBACK
       This  document,  and  the  package  it  describes,  will undoubtedly contain bugs and other problems.
       Please  report  such  in  the  category  ripemd   of   the   Tcllib   SF   Trackers   [http://source -
       forge.net/tracker/? group_id=12883].   Please  also report any ideas for enhancements you may have for
       either package and/or documentation.

SEE ALSO
       md4, md5, ripemd128, sha1

KEYWORDS
       RIPEMD, hashing, md4, message-digest, rfc 1320, rfc 1321, rfc 2104, security

CATEGORY
       Hashes, checksums, and encryption

COPYRIGHT
       Copyright (c) 2004, Pat Thoyts <patthoyts@users.sourceforge.net>




ripemd                                              1.0.3                                       ripemd160(n)

Сообщение о проблемах

Способ сообщить о проблеме с этой страницей руководства зависит от типа проблемы:

Ошибки содержания
Ошибки отчета в содержании этой документации со ссылками на отзыв ниже.
Отчеты об ошибках
Сообщите об ошибках в функциональности описанного инструмента или API через Генератор отчетов Ошибки.
Форматирование проблем
Отчет, форматирующий ошибки в интерактивной версии этих страниц со ссылками на отзыв ниже.