SHA-256 Password Conversion
---------------------------

Author: Samson of Alsherok
Using code provided by Con Kolivas and Olivier Gay. See the sha256.c/h files for full credits.

Prerequisite Requirements
-------------------------

An existing mud using crypt() or MD5 for player passwords,
or pfiles with unencrypted passwords.

Terms of Use
------------

1. You may use this snippet in your code provided that any included
comment headers in the code are left intact. You may add your own, but
do not take mine out.

2. This snippet may not be posted for redistribution on any site
without obtaining prior written consent from the Alsherok team.

3. ( optional ) Register with the forums at https://smaugmuds.afkmud.com
Registration is not required to make use of the snippet, but since I no
longer provide email support for any of the code I release, forum posts
are your only avenue for direct support. This may seem overly stupid,
but you can blame the continuing abuse I suffer from spammers for this.

If you can't agree to these terms, don't use this code, and don't expect
me to help if something breaks while installing it. Harsh? Hardly. I'm
tired of people who come crawling to whine and complain when they haven't
bothered to comply with the terms first.

What this code does
-------------------

This code will update your MUD to use the SHA-256 password encryption algorithm
to store encrypted passwords on pfiles. This algorithm is generally accepted
to be stronger than the standard crypt() and allows for passwords of longer
than 8 characters in length. It also has the advantage of being entirely
portable so you can take your game to any server, anywhere, and be able to
use encrypted pfile passwords without depending on the system's crypt()
library. This code is intended to be used as a bridge point for your older
pfiles. If they are not being stored in encrypted format, then this code will
allow those passwords to become encrypted easily. Once the conversion of all
of your pfiles is complete, it is no longer necessary to have this code installed.

This code comes in two varieties: New install, and MD5 replacement. Use the
appropriate instructions for what you have.

This code has been installed and tested on Smaug 1.6 FUSS, which is a bugfixed
and cleaned up version of the base Smaug 1.4a code. The Smaug FUSS Project is
maintained on servers which run the Redhat and Fedora family of Linux. Limited
testing has also been done on the Cygwin package under WindowsXP SP1 and SP2.
Users of BSD, MSVC, MSVC++, or Macintosh platforms are on their own as The
Smaug FUSS Project does not have access to these development environments for testing.
The Smaug FUSS Project can be found at: https://smaugmuds.afkmud.com

No guarantees are made that this code will be compatible with your codebase and any
modifications you may have made to it. No warranty of any kind is expressed or implied
by the use of this code, and we are not responsible for any damages which may result
from the application of this snippet to your codebase.
