HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/ri/3.0.0/system/String/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 <code>crypt(3)</code> ;TI"9standard library function with <code>str</code> and ;TI"H<code>salt_str</code>, 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::BlankLineo:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;	[o;
;	[I"DBehaviour of C's <code>crypt(3)</code> 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, <code>crypt(3)</code> never fails ;TI"3(i.e. silently ends up in unexpected results).;T@o;;0;	[o;
;	[I"?On some OSes such as Mac OS, <code>crypt(3)</code> is not ;TI"thread safe.;T@o;;0;	[o;
;	[	I"DSo-called "traditional" usage of <code>crypt(3)</code> is very ;TI"Dvery very weak.  According to its manpage, Linux's traditional ;TI"A<code>crypt(3)</code> 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 <code>salt_str</code> parameter, by hand. ;TI"@Failure in generation of a proper salt string tends not to ;TI"<yield any errors; typos in parameters are normally not ;TI"detectable.;T@o;;
;;[o;;0;	[o;
;	[	I"CFor instance, in the following example, the second invocation ;TI"@of String#crypt is wrong; it has a typo in "round=" (lacks ;TI"D"s").  However the call does not fail and something unexpected ;TI"is generated.;T@o:RDoc::Markup::Verbatim;	[I"<"foo".crypt("$5$rounds=1000$salt$") # OK, proper usage
;TI"="foo".crypt("$5$round=1000$salt$")  # Typo not detected
;T:@format0o;;0;	[o;
;	[I"DEven in the "modular" mode, some hash functions are considered ;TI"Carchaic and no longer recommended at all; for instance module ;TI"A<code>$1$</code> is officially abandoned by its author: see ;TI"Bhttp://phk.freebsd.dk/sagas/md5crypt_eol.html .  For another ;TI"?instance module <code>$3$</code> 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, <code>crypt(3)</code> 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"><code>require 'string/crypt'</code> 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