Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- port io.StdIn._
- import scala.io.Source
- import java.io.PrintWriter
- if (args(0) == "encrypt") {
- val out1 = new PrintWriter(args(2)+".msg")
- val out2 = new PrintWriter(args(2)+".key")
- val in = Source.fromFile(args(1))
- val r = scala.util.Random
- for (c <- in)
- out2.print(if (c == '/n') {
- /n
- } else {
- r.nextInt(95).toChar
- }
- )
- in.close
- out1.close
- out2.close
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement