Index: config.template.php
===================================================================
--- config.template.php	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ config.template.php	(revision f4830e018ea7027f56c99df9367e7873056a7528)
@@ -1,10 +1,8 @@
 <?php
-$db_meta_server = '127.0.0.1';
-$db_meta_port = '3306';
+$db_server = '127.0.0.1';
+$db_port = '3306';
 $db_meta_db = 'pass_dist_metadata';
 $db_meta_user = '';
 $db_meta_pass = '';
-$db_pass_server = '127.0.0.1';
-$db_pass_port = '3306';
 $db_pass_db = 'pass_dist_passwords';
 $db_pass_user = '';
Index: create.php
===================================================================
--- create.php	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ create.php	(revision f4830e018ea7027f56c99df9367e7873056a7528)
@@ -24,52 +24,28 @@
 <?php }
 else {
-	// We're creating something
-
-	// Random padding
-	//$salt = mcrypt_create_iv ( 16, MCRYPT_RAND );
-	$salt = \Sodium\randombytes_buf(\Sodium\CRYPTO_PWHASH_SALTBYTES);
-
-	// Value sent to end user to collect password
+	$salt = mcrypt_create_iv ( 16, MCRYPT_RAND );
 	$hash = md5 ( mcrypt_create_iv ( 128, MCRYPT_RAND ) );
-
-	// ID sent to end user
 	$id = substr ( md5 ( mcrypt_create_iv ( 128, MCRYPT_RAND ) ), 4, 6 );
 	
-	//TODO: Check ID is valid against db
-
-	// Metadata
+	//CheckID is valid against db
+	
 	$reference = $_POST[ 'reference' ];
+	$password = $_POST[ 'passwd' ];
 	$username = $_SERVER[ 'REMOTE_USER' ];
-	$username = "test";
-
-	// What we're actually storing
-	$password = $_POST[ 'passwd' ];
-
-	// AES initialisation vector	
+	
 	$iv = mcrypt_create_iv ( 32, MCRYPT_RAND );
 	
-	// AES KDF - This needs to be a more secure hash - maybe run 100000 cycles? or move to sCrypt?
-	// $key = pack ( 'H*', hash ( 'sha256', $salt . $reference . $hash ) );
-	$key = \Sodium\crypto_pwhash(
-			32, //AES256 - 256/8 = 32
-			$reference . $hash,
-			$salt,
-			\Sodium\CRYPTO_PWHASH_OPSLIMIT_MODERATE,
-			\Sodium\CRYPTO_PWHASH_MEMLIMIT_MODERATE
-		);
-
-	// Get the Ciphertext
+	//This needs to be a more secure hash - maybe run 100000 cycles? or move to sCrypt?
+	$key = pack ( 'H*', hash ( 'sha256', $salt . $reference . $hash ) );
+	
 	$enc = encrypt ( $password, $key, $iv );
 	
-	// This needs to be a more secure hash - maybe run 100000 cycles? or move to sCrypt?
+	//This needs to be a more secure hash - maybe run 100000 cycles? or move to sCrypt?
 	$check = pack ( 'H*', hash ( 'sha256', $enc . $hash ) );
 	
-	// Add to database
-	create_password ( $id, $reference, date( "Y-m-d H:i:s" ), $username, $salt, $iv, $check, $enc );
-
-	// Output some stuff
-	?>
-
-		<p>Congratulations - hash created - <?php echo ( $hash ); ?> - id - <?php echo ( $id ); ?>. Key: <?php print_r ( unpack( 'H*', $key ) ); ?>, Salt: <?php print_r ( unpack( 'H*', $salt ) ); ?></p>
+	
+	create_password ( $id, $reference, date( "Y-m-d H:i:s" ), $username, $salt, $iv, $check, $enc ); ?>
+	
+	<p>Congratulations - hash created - <?php echo ( $hash ); ?> - id - <?php echo ( $id ); ?>. </p>
 	
 <?php }
Index: include.php
===================================================================
--- include.php	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ include.php	(revision f4830e018ea7027f56c99df9367e7873056a7528)
@@ -16,10 +16,10 @@
 try {
 	$meta_dbh = new PDO(
-		'mysql:host=' . $db_meta_server . ';port=' . $db_meta_port . ';dbname=' . $db_meta_db,
+		'mysql:host=' . $db_server . ';port=' . $db_port . ';dbname=' . $db_meta_db,
 		$db_meta_user,
 		$db_meta_pass);
 		
 	$pass_dbh = new PDO(
-		'mysql:host=' . $db_pass_server . ';port=' . $db_pass_port . ';dbname=' . $db_pass_db,
+		'mysql:host=' . $db_server . ';port=' . $db_port . ';dbname=' . $db_pass_db,
 		$db_pass_user,
 		$db_pass_pass);
Index: index.php
===================================================================
--- index.php	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ index.php	(revision f4830e018ea7027f56c99df9367e7873056a7528)
@@ -48,16 +48,8 @@
 		die ( 'Incorrect hash' );
 	}
-	print_r ( unpack ( "H*", $salt ) );	
+	
 	delete_password ( $pass_id, $REASON_SUCCESS );
 	
-	// $key = pack( 'H*', hash( 'sha256', $salt . $reference . $hash ) );
-	$key = \Sodium\crypto_pwhash(
-			32, //AES256 - 256/8 = 32
-			$reference . $hash,
-			$salt,
-			\Sodium\CRYPTO_PWHASH_OPSLIMIT_MODERATE,
-			\Sodium\CRYPTO_PWHASH_MEMLIMIT_MODERATE
-		);
-
+	$key = pack( 'H*', hash( 'sha256', $salt . $reference . $hash ) );
 	$dec = decrypt ( $password, $key, $iv ); ?>
 	
Index: ge_footer.html
===================================================================
--- page_footer.html	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ 	(revision )
@@ -1,2 +1,0 @@
-	</body>
-</html>
Index: ge_header.html
===================================================================
--- page_header.html	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ 	(revision )
@@ -1,4 +1,0 @@
-<html>
-	<head>
-	</head>
-	<body>
Index: ss_dist_metadata.sql
===================================================================
--- pass_dist_metadata.sql	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ 	(revision )
@@ -1,51 +1,0 @@
--- phpMyAdmin SQL Dump
-
-SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
-SET time_zone = "+00:00";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Database: `pass_dist_metadata`
---
-CREATE DATABASE IF NOT EXISTS `pass_dist_metadata` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
-USE `pass_dist_metadata`;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `metadata`
---
-
-CREATE TABLE IF NOT EXISTS `metadata` (
-	  `id` varchar(6) NOT NULL,
-	  `reference` varchar(10) NOT NULL,
-	  `password_id` int(11) NOT NULL,
-	  `date_created` datetime NOT NULL,
-	  `date_deleted` datetime DEFAULT NULL,
-	  `delete_reason` int(11) DEFAULT NULL,
-	  `username` varchar(100) NOT NULL,
-	  `salt` binary(16) NOT NULL,
-	  `iv` binary(32) NOT NULL,
-	  `code_check` binary(32) NOT NULL,
-	  `bad_attempts` int(11) NOT NULL
-	) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-	--
--- Indexes for dumped tables
---
-
---
--- Indexes for table `metadata`
---
-ALTER TABLE `metadata`
- ADD PRIMARY KEY (`id`);
-
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-
Index: ss_dist_password.sql
===================================================================
--- pass_dist_password.sql	(revision c2f407588ed516b8cf12343da4b654d7b4892370)
+++ 	(revision )
@@ -1,51 +1,0 @@
--- phpMyAdmin SQL Dump
-
-SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
-SET time_zone = "+00:00";
-
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-
---
--- Database: `pass_dist_passwords`
---
-CREATE DATABASE IF NOT EXISTS `pass_dist_passwords` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
-USE `pass_dist_passwords`;
-
--- --------------------------------------------------------
-
---
--- Table structure for table `passwords`
---
-
-CREATE TABLE IF NOT EXISTS `passwords` (
-	`id` int(11) NOT NULL,
-	  `password` longblob NOT NULL
-	) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
-
-	--
--- Indexes for dumped tables
---
-
---
--- Indexes for table `passwords`
---
-ALTER TABLE `passwords`
- ADD PRIMARY KEY (`id`);
-
---
--- AUTO_INCREMENT for dumped tables
---
-
---
--- AUTO_INCREMENT for table `passwords`
---
-ALTER TABLE `passwords`
-MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-
