Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;

public class Main {
    private static byte[] iv() {
        byte[] iv = null;
        try {
            KeyGenerator kgen = KeyGenerator.getInstance("AES");
            kgen.init(128);
            SecretKey skey = kgen.generateKey();
            iv = skey.getEncoded();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return iv;
    }
}