Rough encrypt

This commit is contained in:
2021-09-02 11:23:35 -04:00
parent 65a34f5b65
commit f8f37fe6e2
15 changed files with 566 additions and 17 deletions

View File

@@ -41,5 +41,8 @@ class Registry { const
DEFAULTTZ = 'America/New_York', // DEFAULT TIME ZONE
HIDEFOOTER = 'false', // HIDE TIMESTAMP FOOTER
AUTHMETHOD = 'INTERNAL', // Auth users using INTERNAL or SAML
AUTHIDP = 'default-sp' // Identity Provider if using SAML
AUTHIDP = 'default-sp', // Identity Provider if using SAML
ENCKEY = 'def00000231550b3ca99ed79ffe1010c5555d9ff9f6b3d0844c65dd5705aa72da77d427c76a50c7a19e52e5e3c38137f2db2d95a4d845c85b691e384d9ba6ee6e706baac'
// CHANGE ME BEFORE USING! Encryption key - 136 char ascii encryption key - generate
// online or via encrypt-test.php. WARNING! Changing after in production WILL BREAK YOUR DATA!!!
;}

View File

@@ -19,6 +19,7 @@
namespace App\LobbySIO\Misc;
use App\LobbySIO\Config\Registry;
use SimpleSAML\Auth\Simple;
use Defuse\Crypto\Key;
/**
* Miscellaneous junk probably not even deserving of a class but whatever
@@ -26,6 +27,11 @@ use SimpleSAML\Auth\Simple;
* @author josh.north
*/
class StaticFunctions {
public function loadEncryptionKeyFromConfig() {
$keyAscii = Registry::ENCKEY;
return Key::loadFromAsciiSafeString($keyAscii);
}
public function getVersion ($app_disp_lang) {
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
$transLang = $Translate->userLanguage();

BIN
src/Misc/defuse-crypto.phar Normal file

Binary file not shown.