Ruby # crypt string in C # and php

I have a ruby ​​client program that encrypts a password using the string # crypt like this

  encrypted = password.crypt(SALT)
  # removing first two characters which actually are the salt for safety
  return encrypted[2, encrypted.size - 2]

it sends it to the server for comparison with the previously stored encrypted string. as I ever needed to send the same encrypted password from a C # application and php web page and still be able to log in with the same password from any other client.

what will be the equivalent code in c # and php for encryption?

+3
source share
1 answer

FROM

  • crypt (3)

    crypt() - . , ( ) .

    - .

    - , [a-zA-Z0-9./]. 4096 .

  • crypt

    str, . - , , , [a-zA-Z0-9./].

PHP

  • crypt

    crypt() Unix DES , .

Python

#

.NET Framework API Unix, , :

+6

Source: https://habr.com/ru/post/1725573/


All Articles