On Fri, May 09, 2014 at 10:02:17AM +0200, Panagiotis Atmatzidis wrote:
> Hello again,
> 
> On 8 ?????? 2014, at 23:12 , Panagiotis Atmatzidis <[email protected]> 
> wrote:
> 
> > Greetings to everyone,
> > 
> > I am trying to configure OpenSMTD with TLS + simple auth in order to be 
> > able to send email from my laptop and mobile using the server.
> > 
> > [...]
> 
> I figure it out! The manuals says it but I missed it yesterday:
> 

perseverance and man page reading is a virtue ;-)


> Password for 'username' must be produces using 'smtpctl encrypt <string>'. 
> The weird thing I noticed is that the produced output is not an ordinary 
> hash. It changes everytime smtpcl issued, for example:
> 
> > smtpctrl encrypt test
> 
> gives 3 different strings
> 
> $6$DpwJ66CLIaGwC.55$VTGkdBNBW9mGRmjUY0zZAsjGLYIKdpqK1R/lfSoAcnvjsaJbrXGrrb/TPYXTEk8TLlwSR5l7Li9LsB9uFE9Rg/
> $6$wXJ.vQFyztde./Tl$vHsfacUMuPRWm25Jtyeh/BGp2v1JljtEzO4iOaETN0Y..74NSlI7jkuauhkJm7hLBi4pO81B/mL8aNiFogk7M1
> $6$oFWDbMAuNrMeCdNJ$u98j5iYOddK.gt1WJm8DOn7qVvQlDLNd1PXD2N6GK8aSRrNz8/FlVbmS1YI0LrbupZDxwsB67bnJS/kIKzJyH/
> 
> I'm not into encryption but out of curiosity, how does the server know what 
> to use? :-)
> 

if you look at the passwords they are split in three:

$6
$DpwJ66CLIaGwC.55
$VTGkdBNBW9mGRmjUY0zZAsjGLYIKdpqK1R/lfSoAcnvjsaJbrXGrrb/TPYXTEk8TLlwSR5l7Li9LsB9uFE9Rg/

First part determines the algorithm to use.
Second part is a random salt which is combined with your password to
generate the third part, the hash.

The random part ensures that two people using the same password do not
produce the same password field in the user database.

When you authenticate, you submit your username and password. The server
uses your username to locate the password string. It then extracts the
algorithm and random salt, uses them with the password you submitted to
generate a hash and compares it with the hash that it has in its user
database.


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to