⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
OpenSSL
/
Digest
/
View File Name :
cdesc-Digest.ri
U:RDoc::NormalClass[iI"Digest:ETI"OpenSSL::Digest;TI"OpenSSL::Digest::Class;To:RDoc::Markup::Document:@parts[o;;[ : @fileI"&ext/openssl/lib/openssl/digest.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ o:RDoc::Markup::Paragraph;[ I"FOpenSSL::Digest allows you to compute message digests (sometimes ;TI"Ainterchangeably called "hashes") of arbitrary data that are ;TI"Icryptographically secure, i.e. a Digest implements a secure one-way ;TI"function.;To:RDoc::Markup::BlankLine o;;[I"DOne-way functions offer some useful properties. E.g. given two ;TI"Edistinct inputs the probability that both yield the same output ;TI"Jis highly unlikely. Combined with the fact that every message digest ;TI"Jalgorithm has a fixed-length output of just a few bytes, digests are ;TI"Joften used to create unique identifiers for arbitrary data. A common ;TI"Jexample is the creation of a unique id for binary documents that are ;TI"stored in a database.;T@o;;[ I"LAnother useful characteristic of one-way functions (and thus the name) ;TI"Fis that given a digest there is no indication about the original ;TI"Mdata that produced it, i.e. the only way to identify the original input ;TI"Fis to "brute-force" through every possible combination of inputs.;T@o;;[I"HThese characteristics make one-way functions also ideal companions ;TI"Gfor public key signature algorithms: instead of signing an entire ;TI"Ldocument, first a hash of the document is produced with a considerably ;TI"Jfaster message digest algorithm and only the few bytes of its output ;TI"Jneed to be signed using the slower public key algorithm. To validate ;TI"Lthe integrity of a signed document, it suffices to re-compute the hash ;TI":and verify that it is equal to that in the signature.;T@o;;[I"MYou can get a list of all digest algorithms supported on your system by ;TI"+running this command in your terminal:;T@o:RDoc::Markup::Verbatim;[I"%openssl list -digest-algorithms ;T:@format0o;;[I"EAmong the OpenSSL 1.1.1 supported message digest algorithms are:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I">SHA224, SHA256, SHA384, SHA512, SHA512-224 and SHA512-256;To;;0;[o;;[I".SHA3-224, SHA3-256, SHA3-384 and SHA3-512;To;;0;[o;;[I"BLAKE2s256 and BLAKE2b512;T@o;;[I"AEach of these algorithms can be instantiated using the name:;T@o; ;[I",digest = OpenSSL::Digest.new('SHA256') ;T;0o;;[I"E"Breaking" a message digest algorithm means defying its one-way ;TI"Kfunction characteristics, i.e. producing a collision or finding a way ;TI"Gto get to the original data by means that are more efficient than ;TI"Gbrute-forcing etc. Most of the supported digest algorithms can be ;TI"Iconsidered broken in this sense, even the very popular MD5 and SHA1 ;TI"Jalgorithms. Should security be your highest concern, then you should ;TI"7probably rely on SHA224, SHA256, SHA384 or SHA512.;T@S:RDoc::Markup::Heading: leveli: textI"Hashing a file;T@o; ;[I"%data = File.binread('document') ;TI",sha256 = OpenSSL::Digest.new('SHA256') ;TI""digest = sha256.digest(data) ;T;0S;;i;I"+Hashing several pieces of data at once;T@o; ;[ I"#data1 = File.binread('file1') ;TI"#data2 = File.binread('file2') ;TI"#data3 = File.binread('file3') ;TI",sha256 = OpenSSL::Digest.new('SHA256') ;TI"sha256 << data1 ;TI"sha256 << data2 ;TI"sha256 << data3 ;TI"digest = sha256.digest ;T;0S;;i;I"Reuse a Digest instance;T@o; ;[I"#data1 = File.binread('file1') ;TI",sha256 = OpenSSL::Digest.new('SHA256') ;TI"$digest1 = sha256.digest(data1) ;TI" ;TI"#data2 = File.binread('file2') ;TI"sha256.reset ;TI"#digest2 = sha256.digest(data2);T;0; I"ext/openssl/ossl_digest.c;T; 0; 0; 0[ [ [ [[I" class;T[[:public[[I"digest;TI"&ext/openssl/lib/openssl/digest.rb;T[I"new;TI"ext/openssl/ossl_digest.c;T[:protected[ [:private[ [I" instance;T[[;[[I"<<;T@‚[I"block_length;T@‚[I"digest_length;T@‚[I"initialize_copy;T@‚[I" name;T@‚[I" reset;T@‚[I"update;T@‚[;[ [;[[I"finish;T@‚[ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[ @I"ext/openssl/ossl.c;TI""lib/rubygems/s3_uri_signer.rb;TI"lib/rubygems/source/git.rb;TI"OpenSSL;TcRDoc::NormalModule