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

    6 4
    5237
    2753
    7523
    5723
    5327
    2537
    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.
    >> 36eecba45a4a8275ac64a08e2aac572eeba91ef6cdcb0ce17d69b4ea4e31c976dfedab0c6b42c49a4d11efdba6fc74322a72eb5d4e244a5a843d807bfa20e289b640c4f09a2b6fdf377da7a39becaeead9482b66bed15f924dddad3eeb61dcd9d6b6ca92d4fadd46a4cb50c349f01148aac55b47
    This will be a 128-bit and 256-bit AES encryption algorithm when I'm done.