CSharp · Console
using System;
using System.Text;
using System.Security.Cryptography;
// Commonly used trivial passwords:
// a +FAwP4iI7/Pu4WB3HdIHbbFmteLahPAVkjJShKeozAA=
// 1 UyiHNQ7D3ZLNnmTna55DMxpGnMfY3omaEpDCu2YdLhg=
// test 2+IIP7ErCPPKxFjJXc59GFx2+w/1VTLHjJ2duc04CYQ=
// 1234 IzjWnFxCJArhBgkJix0BVpjKp5JRnxZoF3nW4XMfWbk=
public class Program
{
public static void Main()
{
var pbkdf2 = new Rfc2898DeriveBytes(
password: Encoding.Unicode.GetBytes("1234"),
salt: Encoding.ASCII.GetBytes("21.project.ets.knx.org"),
iterations: 65536,
hashAlgorithm: HashAlgorithmName.SHA256);
var zipPassword = Convert.ToBase64String(pbkdf2.GetBytes(32));
Console.WriteLine(zipPassword);
}
}