Yealink Forums

Full Version: AES Encryption
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok now.
This is a AES Encryption tool for Unix/Linux systems.

If it useful for you, please support open source, [Image: btn_donate_SM.gif]
Additional information - because of some bug in firmware, first of all put something like 11111 or something else to the Common/Mac file AES Encryption key field and make apply. Then put a real key in this fields.
Here is the same algorithm written in perl. Key supplied as argument (must be 16 characters) and config file fed into stdin, encrypted file is printed to stdout.

Code:
#!/usr/bin/perl -w
use Crypt::Mode::ECB;

my $key = $ARGV[0]; # length has to be 16 characters
my $plaintext = do { local $/; <STDIN> };
# Pad to a multiple of 16 (128 bits) with spaces
my $pad=(16-(length($plaintext) % 16)) % 16;
for (my $n=0; $n<$pad; $n++) {
        $plaintext .= ' ';
}
my $c = Crypt::Mode::ECB->new('AES', 0);
print($c->encrypt($plaintext, $key));
Pages: 1 2
Reference URL's