Skip to content

Commit 01a4898

Browse files
committed
Update 2.0 for JSrandom
1 parent b6eb351 commit 01a4898

File tree

20 files changed

+610
-16
lines changed

20 files changed

+610
-16
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Introducing
22
# **JSrandom**
3-
![JSrandom logo](JSrandomlogo.png)
3+
![JSrandom logo](webapp/JSrandomlogo.png)
44
## A random password generator made with Javascript
5-
JSrandom is a secure random password generator, built with HTML, CSS and most importantly in Javascript.
5+
JSrandom is a secure random password generator, built with HTML, CSS and most importantly with Javascript.
66

77
Your password will be generated in the matter of seconds after choosing the parameters you want for your password.
88
* **Lenght**
@@ -36,7 +36,7 @@ Just use the web version you can find at this [link](https://buct0r.github.io/JS
3636

3737
#### Windows
3838
Go to the [release page](https://github.com/Buct0r/JSrandom/releases), download the executable and run it. As simple as that.
39-
You can also run the executable in the terminal, also because is a terminal application
39+
You can also run the executable in the terminal, also because is a terminal application.
4040

4141

4242
#### Linux
@@ -68,11 +68,18 @@ and then:
6868
```
6969
./JSrandom.py
7070
```
71+
# Update 2.0
7172

73+
This is the biggest update of JSrandom, with a new introduction page, new effects for the UI and the introduction of a copy button (finally) on the webapp, to quickly copy your passwords.
74+
75+
## Browser extensions
76+
I'm also introducing the web extension of JSrandom for chromium based browsers and Firefox. For Firefox just broswe to the AMO page at this [link](https://addons.mozilla.org/it/firefox/addon/jsrandom/). For the chromium version, for now I can't publish it on the Chrome web store, but you can find it on the [release page](https://github.com/Buct0r/JSrandom/releases) as a zip file, that you can add to your browser enabling developer mode and uploading the zip file.
7277

7378
### Conclusion
7479
Since the executable is not signed, your antivirus will probably block it. If you want you can add an exeption in your antivirus settings or if you don't trust the exe, just download the python file and run it with python.
7580

81+
In the next week I will try to find a solution to add the extension to the Chrome web store.
82+
7683
Thanks to skesko for the collaboration with the testing phase. :3
7784

7885
Developed by Buct0r❤️

JSrandom.py renamed to cli/JSrandom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import random
22

3-
print("**********PASSWORD GENERATOR**********")
3+
print("***************JSrandom***************")
44
while True:
55
lettersL = "abcdefghijklmnopqrstuvwxyz"
66
lettersU = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

extention/Firefox/borderify.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document.body.style.border = "5px solid black"

extention/Firefox/index.css

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
body{
2+
text-align: center;
3+
font-family: "Roboto", sans-serif;
4+
font-weight: 500;
5+
font-style: normal;
6+
background-color: rgb(83, 0, 83);
7+
width: 300px;
8+
}
9+
10+
11+
.divs{
12+
border-style: solid;
13+
border-radius: 10px;
14+
border-color: grey;
15+
width: 200px;
16+
height: auto;
17+
background-color: grey;
18+
background-repeat: no-repeat;
19+
background-attachment: fixed;
20+
padding: 5px;
21+
margin: 0 auto;
22+
margin-bottom: 50px;
23+
padding: 5px;
24+
margin-bottom: 13px;
25+
26+
}
27+
28+
.divs label{
29+
font-size: 1.2em;
30+
font-weight: bolder;
31+
}
32+
33+
34+
35+
36+
#title{
37+
font-size: 1em;
38+
color: black;
39+
}
40+
41+
#generate{
42+
background: yellow;
43+
border-style: solid;
44+
border-radius: 10px;
45+
border-color: black;
46+
border-width: 2px;
47+
width: 100px;
48+
height: 45px;
49+
text-align: center;
50+
font-size: 1.4em;
51+
}
52+
53+
#generate:hover{
54+
background: rgb(207, 207, 0);
55+
}
56+
57+
#generate:active{
58+
background: rgb(173, 173, 0);
59+
}
60+
61+
#Length{
62+
margin-top: 7px;
63+
margin-bottom: 10px;
64+
width: 100px;
65+
height: 25px;
66+
font-size: 1.5em;
67+
text-align: center;
68+
border-radius: 10px;
69+
border-style: solid;
70+
border-color: white;
71+
}
72+
73+
.check{
74+
zoom: 1.5;
75+
transform: scale(1.5);
76+
-ms-transform: scale(1.5);
77+
-webkit-transform: scale(1.5);
78+
-o-transform: scale(1.5);
79+
-moz-transform: scale(1.5);
80+
transform-origin: 0 0;
81+
-ms-transform-origin: 0 0;
82+
-webkit-transform-origin: 0 0;
83+
-o-transform-origin: 0 0;
84+
-moz-transform-origin: 0 0;
85+
margin-bottom: 10px;
86+
display: inline;
87+
}
88+
89+
#Password{
90+
height: auto;
91+
width: 170px;
92+
text-align: center;
93+
overflow-x: auto;
94+
overflow-y: auto;
95+
margin: auto;
96+
font-size: 0.7em;
97+
font-weight: bold;
98+
margin-bottom: 5px;
99+
}
100+
101+
#result{
102+
display: inline-block;
103+
}
104+
105+
#copy{
106+
background-color: whitesmoke;
107+
border-radius: 10px;
108+
border: 1px solid;
109+
margin-top: auto;
110+
margin-left: 5px;
111+
}
112+
113+
#copy:hover{
114+
background-color: rgb(211, 210, 210);
115+
}
116+
117+
#copy:active{
118+
background-color: rgb(165, 165, 165);
119+
}
120+

extention/Firefox/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" href="index.css">
4+
</head>
5+
<body>
6+
<img src="logo.png" style="margin-top: 3px;">
7+
<h1 id="title" style="margin-left: auto; margin-right: auto;">A random password generator made with Javascript</h1>
8+
<div class="divs">
9+
<label>Password length:</label><br>
10+
<input type="number" id="Length" alt="Put here the length of the password you want to generate"><br>
11+
12+
<label>Lowercase</label>
13+
<input id="lower" class="check" type="checkbox" alt="Check this if you want to include lowercase characters"><br>
14+
15+
<label>Uppercase</label>
16+
<input id="upper" class="check" type="checkbox" alt="Check this if you want to include uppercase characters"><br>
17+
18+
<label>Symbols</label>
19+
<input id="symb" class="check" type="checkbox" alt="Check this if you want to include symbols"><br>
20+
21+
<label>Numbers</label>
22+
<input id="numb" class="check" type="checkbox" alt="Check this if you want to include numbers"><br><br>
23+
24+
<button type="submit" id="generate" alt="click here to generate the password"><a>Generate</a></button><br><br>
25+
26+
<span>Generated password:</span><br>
27+
<div id="result">
28+
<div type="text" id="Password" alt="There you have it, your generated password"></div><button id="copy"><svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 -960 960 960" width="20px" fill="#000000"><path d="M360-240q-29.7 0-50.85-21.15Q288-282.3 288-312v-480q0-29.7 21.15-50.85Q330.3-864 360-864h384q29.7 0 50.85 21.15Q816-821.7 816-792v480q0 29.7-21.15 50.85Q773.7-240 744-240H360Zm0-72h384v-480H360v480ZM216-96q-29.7 0-50.85-21.15Q144-138.3 144-168v-552h72v552h456v72H216Zm144-216v-480 480Z"/></svg></button><br>
29+
</div>
30+
</div>
31+
<script src="index.js"></script>
32+
</body>
33+
</html>

extention/Firefox/index.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
const Generate = document.getElementById("generate");
2+
const text = document.getElementById("Password");
3+
const copy = document.getElementById("copy");
4+
5+
let passwordLength
6+
let includeLowercase
7+
let includeUppercase
8+
let includeNumbers
9+
let includeSymbols
10+
11+
12+
let allowedChars = ""
13+
let generatedPassword = ""
14+
15+
16+
const lowercaseChars = "abcdefghijklmnopqrstuvwxyz";
17+
const uppercaseChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
18+
const numberChars = "0123456789";
19+
const symbolChars = "!@#$%^&*()_+-=";
20+
21+
22+
23+
Generate.onclick = function(){
24+
25+
passwordLength = document.getElementById("Length").value;
26+
includeLowercase = document.getElementById("lower");
27+
includeUppercase = document.getElementById("upper");
28+
includeNumbers = document.getElementById("numb");
29+
includeSymbols = document.getElementById("symb");
30+
31+
32+
function password(passwordLength, includeLowercase, includeUppercase, includeNumbers, includeSymbols){
33+
34+
35+
allowedChars += includeLowercase.checked ? lowercaseChars : "";
36+
allowedChars += includeUppercase.checked ? uppercaseChars : "";
37+
allowedChars += includeNumbers.checked ? numberChars : "";
38+
allowedChars += includeSymbols.checked ? symbolChars : "";
39+
40+
41+
42+
if(passwordLength <= 0 || passwordLength==null){
43+
return `(Password length must be at least 1)`;
44+
}
45+
if(allowedChars.length === 0){
46+
return `(At least 1 set of character needs to be selected)`;
47+
}
48+
49+
for(let i = 0; i < passwordLength; i++){
50+
const randomIndex = Math.floor(Math.random() * allowedChars.length);
51+
generatedPassword += allowedChars[randomIndex];
52+
}
53+
54+
return generatedPassword;
55+
}
56+
57+
const Password = password(passwordLength, includeLowercase, includeUppercase, includeNumbers, includeSymbols);
58+
59+
60+
61+
text.textContent = Password;
62+
console.log(Password);
63+
generatedPassword = "";
64+
allowedChars = "";
65+
}
66+
67+
copy.onclick = function(){
68+
navigator.clipboard.writeText(text.textContent);
69+
}
70+

extention/Firefox/logo.png

4.91 KB
Loading

extention/Firefox/manifest.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"manifest_version": 2,
3+
"name": "JSrandom",
4+
"version": "1.0",
5+
6+
"icons":{
7+
"128": "logo.png"
8+
},
9+
"browser_action": {
10+
"default_icon": "logo.png",
11+
"default_title": "JSrandom",
12+
"default_popup": "index.html"
13+
}
14+
}

0 commit comments

Comments
 (0)