language: Go (gc-2010-07-14)
date: 202 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
 
import (
        "fmt"
        "time"
        "rand"
)
 
type Key128 [128]byte
type Key256 [256]byte
 
func main() {
        key := new(Key128)
        fmt.Println("Created key of length", len(key))
        fmt.Println("Seeding randomization...")
        fmt.Println("NOTICE: This randomization is not top-notch security as it must run in a sandbox.")
        rand.Seed(time.Nanoseconds())
        fmt.Println("Randomization seeded.")
        fmt.Println("Generating", len(key), "random bytes for key.")
        for i := 0; i < len(key); i++ {
                key[i] = byte(rand.Int()%255)
        }
        fmt.Println("Key created.")
        fmt.Printf(">> ")
        for b := 0; b < len(key); b++ {
                for count := 0; count < 15; count++ {
                        fmt.Printf("%x", key[b])
                        b++
                }
        }
        fmt.Printf("\n")
        fmt.Println("This will be a 128-bit and 256-bit AES encryption algorithm when I'm done.")
}
 
  • upload with new input
  • result: Success     time: 0s    memory: 2444 kB     returned value: 0

    Created key of length 128
    Seeding randomization...
    NOTICE: This randomization is not top-notch security as it must run in a sandbox.
    Randomization seeded.
    Generating 128 random bytes for key.
    Key created.
    >> 5363dfa77bd2d4563e011ae1eb068333071827bd49adce617e947ed27f97170bbace7ad9c6f63d1970d2064ce4161b8661ceded4b1e767beda841b905e737d5249259d4b4dbd35c1d84a6a13cb126c3c15ca9e1b657332e727e9ddc81d30c4bdae38e8bee5ac3a41e610c23543bf9c577bd2ec
    This will be a 128-bit and 256-bit AES encryption algorithm when I'm done.