peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.31k stars 201 forks source link

Peachpie crypt behavior #1110

Closed hey-red closed 1 year ago

hey-red commented 1 year ago

php crypt can successfully generate hash if password length lower than 8, but peachpie throws an exception:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
         at System.String.get_Chars(Int32 index)
         at Pchp.Library.Strings.DES.Crypt(String password, String setting)
         at Pchp.Library.Strings.crypt(String str, String salt)

Example code:

<?php
echo crypt("passwor", "as"); // => asMCHF81kwrKs
jakubmisek commented 1 year ago

thank you for reporting the issue!