Skip to content

Commit

Permalink
Landig page deprecate old encryption #154
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Nov 16, 2021
1 parent 33f14ff commit 1fb0f90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
12 changes: 6 additions & 6 deletions app/landing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ <h4>In case you forget your password you can use this backup key to get back you
Generate key
</button>

<hr />
<!-- <hr />
<h3>Use new encryption method</h3>
<h4>A new more secure encryption method for your codes (Default after 2.7.0).</h4>
<h3>Window capture</h3>
<h4>Allows screenshots and screen capture. You can record or screenshot the app.</h4>
<div class="flex justify-center items-center w-72 h-[68px] bg-white mx-auto rounded-full">
<div class="relative inline-block w-10 mr-2 align-middle select-none bg-gray-900 border-2 border-gray-900 rounded-full">
<input checked onclick="encryptionMethodToggle()" id="tgl0" type="checkbox" class="toggle checked:bg-white outline-none focus:outline-none right-5 duration-200 ease-in absolute block w-4 h-4 rounded-full top-1 bg-black appearance-none cursor-pointer" />
<input onclick="toggleWindowCapture()" id="tgl0" type="checkbox" class="toggle checked:bg-white outline-none focus:outline-none right-5 duration-200 ease-in absolute block w-4 h-4 rounded-full top-1 bg-black appearance-none cursor-pointer" />
<label for="tgl0" class="toggle-bg block overflow-hidden h-6 rounded-full bg-white cursor-pointer"></label>
</div>
<span id="tgt0" class="text-black text-xl">On</span>
</div>
<span id="tgt0" class="text-black text-xl">off</span>
</div> -->
</div>
</div>
</div>
Expand Down
18 changes: 1 addition & 17 deletions app/landing/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ const hashPasswords = async () => {
}

const password_input = Buffer.from(document.querySelector("#password_input1").value)
const new_encryption = document.querySelector("#tgl0").checked

const salt = await bcrypt.genSalt(10)

const hashed = await bcrypt.hash(password_input.toString(), salt).then(logger.log("Hash completed!"))

/**
Expand All @@ -122,11 +120,7 @@ const hashPasswords = async () => {

file.security.require_password = true
file.security.password = hashed

if (new_encryption === true) {
file.security.new_encryption = true
file.security.key = aes.generateSalt().toString("base64")
}
file.security.key = aes.generateSalt().toString("base64")

/**
* Load storage
Expand All @@ -142,7 +136,6 @@ const hashPasswords = async () => {

storage.require_password = file.security.require_password
storage.password = hashed
storage.new_encryption = file.security.new_encryption
storage.key = file.security.key

if (storage.backup_key !== undefined) {
Expand Down Expand Up @@ -182,8 +175,6 @@ const noPassword = () => {
})
.then((result) => {
if (result.response === 0) {
const new_encryption = document.querySelector("#tgl0").checked

text.style.color = "#28A443"
text.textContent = "Please wait!"

Expand All @@ -198,12 +189,6 @@ const noPassword = () => {

file.security.require_password = false

if (new_encryption === true) {
file.security.new_encryption = true
} else {
file.security.new_encryption = false
}

/**
* Load storage
* @type {LibStorage}
Expand All @@ -218,7 +203,6 @@ const noPassword = () => {

storage.require_password = file.security.require_password
storage.password = password.toString("base64")
storage.new_encryption = file.security.new_encryption
storage.key = salt.toString("base64")

if (storage.backup_key !== undefined) {
Expand Down

0 comments on commit 1fb0f90

Please sign in to comment.