Posted October 6, 20213 yr comment_63120 Hey guys, Today I'm making a guide on how you can encrypt your player(s) passwords! I made this initially for PlatinumPS (Now leaked) Note: We will be saving the encryption key as plaintext in the server files for this tutorial. This is obviously a terrible idea for most applications, however you can adapt the code to store the key somewhere else if you want to. The purpose of doing this is to stop people who gain unauthorised access to your player files from using the passwords nefariously. First step - Creating Encryptor.java in your server files. I have left an example key as you'll see. Change this! Encryptor.java This is the hidden content, please Sign In or Sign Up Next - Using the methods So, we want to encrypt a players password, and then upon login, we also want to decrypt it. Go ahead and open PlayerLoading.java and PlayerSaving.java. In your PlayerSaving file, replace your previous password line with: PlayerSaving.java This is the hidden content, please Sign In or Sign Up Now, in your player loading file, replace your previous password loading with this; (If your code didn't have the bottom part, just take the top parts that actually handle the encryption) PlayerLoading.java This is the hidden content, please Sign In or Sign Up The code above allows you to implement this onto a server without deleting all of the old accounts that don't have an encrypted password. Please note - You can NEVER change the encryption key without decrypting all passwords first! You could edit the method to decrypt with the current, and then re-encrypt with a new key if you really wanted to. If anyone finds out your key, you're a moron. Be safe, respect your players privacy. Before: After: I also made a command that I recommend only for server owners. This allows you to recover a decrypted password from a player, even when offline. This is the hidden content, please Sign In or Sign Up
Create an account or sign in to comment