Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Implementation of Unix crypt using System.Security.Cryptography

Overlooking the weak security provided by DES, I'm looking for a C# implementation of the Unix crypt() function that uses classes/methods in the .net framework's Cryptography namespace.

I found this: http://www.codeproject.com/Articles/9183/A-C-implementation-of-Unix-crypt

But I'm wondering if there's a shorter solution using DESCryptoServiceProvider, etc.

like image 556
SFun28 Avatar asked Oct 28 '25 07:10

SFun28


1 Answers

An implementation of Unix crypt you mentioned is rather slow.

Here is a standalone lightweight and pretty efficient implementation of crypt(3) written in C# that leverages Span<T> type to hold and transform data.

like image 148
roxton Avatar answered Oct 31 '25 02:10

roxton