All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.megatronking.stringfog.plugin.kg.HardCodeKeyGenerator Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package com.github.megatronking.stringfog.plugin.kg;

import com.github.megatronking.stringfog.IKeyGenerator;

import java.nio.charset.StandardCharsets;

/**
 * Hard code a binary security key for encryption.
 *
 * @author Megatron King
 * @since 2022/2/14 22:34
 */
public class HardCodeKeyGenerator implements IKeyGenerator {

    private final byte[] mKey;

    public HardCodeKeyGenerator(String key) {
        this(key.getBytes(StandardCharsets.UTF_8));
    }

    public HardCodeKeyGenerator(byte[] key) {
        mKey = key;
    }

    @Override
    public byte[] generate(String text) {
        return mKey;
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy