Blogposts tagged encryptf.zz.dehttps://f.zz.de/tags/encrypt/f.zz.deikiwiki2017-06-27T13:03:24ZSupermicro IPMIView and passwordshttps://f.zz.de/posts/201706271406.supermicro_ipmiview_and_passwords/Florian Lohoff2017-06-27T13:03:24Z2017-06-27T12:06:19Z
<p>Supermicro did a "wonderful" job in making it hard for people to create
automatic configs for <a href="http://www.supermicro.com/solutions/SMS_IPMI.cfm">IPMIView</a>. You can enter username,
password and ip address and IPMIView will store it, but for additional
security it will "encrypt" the password. They wont tell you how to do
it, but will offer <a href="https://www.supermicro.com/support/faqs/faq.cfm?faq=15410">a tool to encrypt the password</a> as a
java jar file. With some java decompiler and debug code i rewrote it in
perl. In the end Supermicro uses the Hostname truncated and padded to
16 bytes as the AES CBC 128 key to encrypt the password.</p>
<pre><code>sub encryptpasswd {
my ($hostname, $password) = @_;
# Key is the hostname truncated to 16
# Padded with NUL to 16 bytes (AES128)
my $key = substr($hostname,0,16);
$key.= "\0" x (16 - length($key));
my $cbc = Crypt::CBC->new(
-cipher=>'Cipher::AES',
-padding => "null",
-keysize => 16,
-literal_key=>1,
-header => "none",
-key=>$key,
-iv => "\0" x 16);
my $ciphertext = $cbc->encrypt($password);
return hexstring($ciphertext);
}
</code></pre>