import scala.collection.immutable.HashMap
import scala.util.matching.Regex
import Crypt._
import java.io.PrintWriter

case class Entry ( account   : String
                 , password  : String
                 , uid       : Int
                 , gid       : Int
                 , gecos     : String
                 , directory : String
                 , shell     : String
                 )

object Entry {
  
  def apply(line: String) : Entry = {
    sys.error("TO BE WRITTEN")
  }

}

object Crack {

  def transformReverse(w: String) : Iterator[String] = {
    sys.error("TO BE WRITTEN")
  }
  
  def transformCapitalize(w: String) : Iterator[String] = {
    sys.error("TO BE WRITTEN")
  }
  
  def transformDigits(w:String) : Iterator[String] = {
    sys.error("TO BE WRITTEN")
  }

  def checkPassword(plain: String, enc: String) : Boolean = 
    Crypt.crypt(enc, plain) == enc
 
  def candidateWords(file: String) =
    Words.wordsMatchingRegexp(file, new Regex("""^.{6,8}$"""))

  // scala> Crack("passwd", "words", "soln.1")
  // goto> scala Crack passwd words soln.1
  def apply(pwdFile: String, wordsFile: String, outFile: String) : Unit = {
    sys.error("TO BE WRITTEN")
  }
  
  def main(args: Array[String]) = { 
    println("Begin: Cracking Passwords")
    apply(args(0), args(1), args(2))
    println("Done: Cracking Passwords")
  }
}

// vim: set ts=2 sw=2 et:

