Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 13th, 2017 57 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. extern crate rand;
  2. extern crate argon2rs;
  3.  
  4. use rand::distributions::{Range, IndependentSample};
  5. use rand::OsRng;
  6. use std::{thread, time};
  7.  
  8. fn main() {
  9.     let alphabet = ["9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
  10.         "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
  11.         "T", "U", "V", "W", "X", "Y", "Z"];
  12.  
  13.     let between = Range::new(0, alphabet.len());
  14.     // use cryptographically secure OsRng, which collects entropy from current operating system
  15.     let mut rng = OsRng::new().unwrap();
  16.  
  17.     for i in 1..6 {
  18.         println!("Generating {}. IOTA seed...", i);
  19.         println!("");
  20.  
  21.         let mut seed = String::new();
  22.         for _ in 0..80 {
  23.             seed += alphabet[between.ind_sample(&mut rng)];
  24.         }
  25.  
  26.         println!("Seed");
  27.         println!("{}", seed);
  28.         println!("");
  29.  
  30.         // print argon2 hash
  31.  
  32.         println!("Argon2 Hash using salt 'cyka bylat'");
  33.         let salt = "cyka bylat";
  34.  
  35.         let result = argon2rs::argon2i_simple(&seed, salt);
  36.         for byte in result.iter() {
  37.             print!("{:02x}", byte);
  38.         }
  39.  
  40.         println!("");
  41.         println!("");
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top