⚝
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 :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
String
/
View File Name :
crypt-i.ri
U:RDoc::AnyMethod[iI" crypt:ETI"String#crypt;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"CReturns the string generated by calling
crypt(3)
;TI"9standard library function with
str
and ;TI"H
salt_str
, in this order, as its arguments. Please do ;TI"Fnot use this method any longer. It is legacy; provided only for ;TI"Fbackward compatibility with ruby scripts in earlier days. It is ;TI"=bad to use in contemporary programs for several reasons:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"DBehaviour of C's
crypt(3)
depends on the OS it is ;TI"7run. The generated string lacks data portability.;T@o;;0; [o; ; [I"DOn some OSes such as Mac OS,
crypt(3)
never fails ;TI"3(i.e. silently ends up in unexpected results).;T@o;;0; [o; ; [I"?On some OSes such as Mac OS,
crypt(3)
is not ;TI"thread safe.;T@o;;0; [o; ; [ I"DSo-called "traditional" usage of
crypt(3)
is very ;TI"Dvery very weak. According to its manpage, Linux's traditional ;TI"A
crypt(3)
output has only 2**56 variations; too ;TI"Ceasy to brute force today. And this is the default behaviour.;T@o;;0; [o; ; [I"BIn order to make things robust some OSes implement so-called ;TI">"modular" usage. To go through, you have to do a complex ;TI"?build-up of the
salt_str
parameter, by hand. ;TI"@Failure in generation of a proper salt string tends not to ;TI"
$1$ is officially abandoned by its author: see ;TI"Bhttp://phk.freebsd.dk/sagas/md5crypt_eol.html . For another ;TI"?instance module
$3$
is considered completely ;TI"(broken: see the manpage of FreeBSD.;T@o;;0; [o; ; [ I"BOn some OS such as Mac OS, there is no modular mode. Yet, as ;TI"Awritten above,
crypt(3)
on Mac OS never fails. ;TI"=This means even if you build up a proper salt string it ;TI"Cgenerates a traditional DES hash anyways, and there is no way ;TI"for you to be aware of.;T@o;; [I">"foo".crypt("$5$rounds=1000$salt$") # => "$5fNPQMxC5j6." ;T;0o; ; [I"HIf for some reason you cannot migrate to other secure contemporary ;TI"Cpassword hashing algorithms, install the string-crypt gem and ;TI">
require 'string/crypt'
to continue using it.;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"&str.crypt(salt_str) -> new_str ;T0[ I" (p1);T@cFI"String;TcRDoc::NormalClass00