Skip to content

Instantly share code, notes, and snippets.

chmod 700 ~/.ssh ; chmod 600 ~/.ssh/authorized_keys ; chmod g-w,o-w ~
chmod 700 ~/.ssh ; chmod 600 ~/.ssh/authorized_keys ; chmod g-w,o-w ~
chmod 700 ~/.ssh ; chmod 600 ~/.ssh/authorized_keys ; chmod g-w,o-w ~
@themonti
themonti / check symfony2 password with python.py
Last active February 7, 2019 16:52
check symfony2 password with python
import hashlib,base64
def checkPass(password,salt):
salted=(password+'{'+salt+'}').encode('utf-8')
if not salt:
salted=password.encode('utf-8')
m=hashlib.sha512()
m.update(salted)
digest=m.digest()
@themonti
themonti / Symfony2PasswordEncode.js
Last active February 14, 2019 12:46 — forked from konstantinzolotarev/Symfony2PasswordEncode.js
Function for node.js that will encrypt password exactly like Symfony2 PHP framework. So all passwords from Symfony2 will work in your node.js application
'use strict';
var crypto = require('crypto');
var _ = require('lodash');
/**
* Will encrypt password in Symfony2 way using a given salt.
*
* @param {string} password
* @param {string} salt