Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. port io.StdIn._
  2. import scala.io.Source
  3. import java.io.PrintWriter
  4.  
  5. if (args(0) == "encrypt") {
  6. val out1 = new PrintWriter(args(2)+".msg")
  7. val out2 = new PrintWriter(args(2)+".key")
  8. val in = Source.fromFile(args(1))
  9. val r = scala.util.Random
  10. for (c <- in)
  11. out2.print(if (c == '/n') {
  12. /n
  13. } else {
  14. r.nextInt(95).toChar
  15. }
  16. )
  17. in.close
  18. out1.close
  19. out2.close
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement