http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=490146#10

--- a/lib/password.rb
+++ b/lib/password.rb
@@ -19,11 +19,6 @@
 #   along with this program; if not, write to the Free Software Foundation,
 #   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-
-require 'crack'
-require 'termios'
-
-
 # Ruby/Password is a collection of password handling routines for Ruby,
 # including an interface to CrackLib for the purposes of testing password
 # strength.
@@ -164,6 +159,8 @@
   # normal operations.
   #
   def Password.echo(on=true, masked=false)
+    require 'termios'
+
     term = Termios::getattr( $stdin )
 
     if on
@@ -183,6 +180,8 @@
   # connected to a tty, no prompt will be displayed.
   #
   def Password.get(message="Password: ")
+    require 'termios'
+
     begin
       if $stdin.tty?
 	Password.echo false
@@ -206,6 +205,8 @@
   # _mask_ to the terminal. There is no need to hit <b>[Enter]</b> at the end.
   #
   def Password.getc(message="Password: ", mask='*')
+    require 'termios'
+
     # Save current buffering mode
     buffering = $stdout.sync
 
@@ -401,6 +402,20 @@
   #
   def crypt(type=DES, salt='')
 
+    # Compatibility with String's crypt method.
+    # Really, salt should be the first argument here.
+    if (type.kind_of?(String) && salt == '')
+      salt = type
+      type = (type =~ /^\$1\$/ ? MD5 : DES)
+    end
+
+    # Compatibility with String's crypt method.
+    # Really, salt should be the first argument here.
+    if (type.kind_of?(String) && salt == '')
+      salt = type
+      type = (salt =~ /^\$1\$/ ? MD5 : DES)
+    end
+
     unless ( salt.split( // ) - SALT_CHARS.split( // ) ).empty?
       raise CryptError, 'bad salt'
     end
@@ -422,8 +437,14 @@
     crypt
   end
 
-end
+  # :stopdoc:
 
+  def check(dict=nil)
+    # Load the crack module (which injects a check method into this class,
+    # overriding this one) and try again.
+    self.send("check") if require 'crack'
+  end
+end
 
 # Display a phonemic password, if run directly.
 #
