-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-started.html
138 lines (121 loc) · 6.16 KB
/
get-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<title>Password4j | Get started</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="David Bertoldi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="description" content="Learn how to install and use Password4j" />
<meta name="keywords" content="encryption, installation, java, argon2, scrypt, bcrypt, pbkdf2, balloon hashing, md5, hash, cryptography">
<meta name="robots" content="index,follow" />
<meta name="subject" content="Install Password4j" />
<meta name="rating" content="General" />
<meta property="og:url" content="https://password4j.com/get-started.html" />
<meta property="og:title" content="Install Password4j" />
<meta property="og:description" content="Learn how to install and use Password4j." />
<meta property="og:image" content="https://password4j.com/images/preview.jpg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="627" />
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/panda-syntax-dark.min.css">
<link rel="canonical" href="https://password4j.com/get-started.html" />
<link rel="manifest" data-n-head="true" href="manifest.json" />
<script type="text/javascript" src="scripts/highlight.min.js"></script>
<script type="text/javascript" src="scripts/app.js"></script>
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "SoftwareSourceCode",
"description": "Learn how to install and use Password4j",
"image": "https://password4j.com/images/preview.jpg",
"name": "Password4j",
"url": "https://github.com/Password4j/password4j"
}
</script>
</head>
<body>
<nav class="topnav" id="myTopnav">
<a class="entry" href="https://github.com/Password4j/password4j" target="_blank" rel="nofollow">Source</a>
<a class="entry" href="https://github.com/Password4j/password4j/wiki" target="_blank" rel="nofollow">Documentation</a>
<a class="entry" href="https://password4j.com/" rel="nofollow">Home</span>
<a href="javascript:void(0);" class="icon" onclick="menu()">
<i class="fa fa-bars"></i>
</a>
</nav>
<header class="hero">
<div class="hero_content">
<a href="index.html">
<h1 class="hero_text">Get started</h1>
</a>
<p class="hero_description">Password4j official guide</p>
</div>
</header>
<main>
<article>
<h2>Prerequisites</h2>
<p>Password4j runs on <strong>Java 8 or higher</strong> by any vendor. You should not find any issue unless you are using a custom homemade JVM.</p>
<p>The minimum supported <strong>Android API level is 26</strong>.</p>
</article>
<article>
<h2>Setup</h2>
<p>If you are working on a Maven project, you can add the following dependency:
<pre><code class="language-html"><dependency>
<groupId>com.password4j</groupId>
<artifactId>password4j</artifactId>
<version>1.8.2</version>
</dependency></code></pre></p>
<p>If you are not using Maven directly, you can still use the dependency from Maven dependency</p>
<h3>Gradle</h3>
<p>Add to your <code>build.gradle</code> module dependencies:
<pre><code class="language-gradle">repositories {
mavenCentral()
}
dependencies {
implementation 'com.password4j:password4j:1.8.2'
}</code></pre></p>
<h3>Scala SBT</h3>
<p>Add to the managed dependencies of your <code>build.sbt</code> the latest version:
<pre><code class="language-java">libraryDependencies += "com.password4j" % "password4j" % "1.8.2"</code></pre></p>
<h3>JAR</h3>
<p>Or you can download the JAR <a href="https://repo1.maven.org/maven2/com/password4j/password4j/" class="link" target="_blank" rel="noopener">here</a> and include it under your classpath.<p>
</article>
<article>
<h2>Happy hashing</h2>
<p><pre><code class="language-java">public class MyService
{
public void protectPassword(User user, String userPassword)
{
Hash hash = Password.hash(userPassword)
.addPepper("shared-secret")
.addRandomSalt(32)
.with2();
save(user, hash.getResult());
}
}</code></pre></p>
</article>
</main>
<footer class="footer">
<div class="footer_content">
<p class="footer_description">Password4j © <script>document.write(/\d{4}/.exec(Date())[0])</script></p>
</div>
</footer>
</body>
</html>