Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
ec3e1e25
Commit
ec3e1e25
authored
8 years ago
by
Vladimir Krivosheev
1
Browse files
Options
Download
Email Patches
Plain Diff
PS: remove unused bouncy-castle dependency
parent
9bcd538d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform/credential-store/credential-store.iml
+0
-1
platform/credential-store/credential-store.iml
platform/credential-store/src/kdbx/kdbx.kt
+6
-8
platform/credential-store/src/kdbx/kdbx.kt
with
6 additions
and
9 deletions
+6
-9
platform/credential-store/credential-store.iml
+
0
-
1
View file @
ec3e1e25
...
...
@@ -15,7 +15,6 @@
<orderEntry
type=
"library"
scope=
"TEST"
name=
"assertJ"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"JUnit4"
level=
"project"
/>
<orderEntry
type=
"module"
module-name=
"testFramework"
scope=
"TEST"
/>
<orderEntry
type=
"library"
name=
"bouncy-castle"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Guava"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"bouncy-castle-provider"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"JDOM"
level=
"project"
/>
...
...
This diff is collapsed.
Click to expand it.
platform/credential-store/src/kdbx/kdbx.kt
+
6
-
8
View file @
ec3e1e25
...
...
@@ -164,18 +164,16 @@ internal interface KdbxEncryption {
private
val
SALSA20_IV
=
DatatypeConverter
.
parseHexBinary
(
"E830094B97205D2A"
)
private
fun
createSalsa20
(
key
:
ByteArray
):
Salsa20Engine
{
val
keyParameter
=
KeyParameter
(
sha256MessageDigest
().
digest
(
key
))
val
engine
=
Salsa20Engine
()
engine
.
init
(
true
,
ParametersWithIV
(
keyParameter
,
SALSA20_IV
))
return
engine
}
/**
* Salsa20 doesn't quite fit the KeePass memory model - all encrypted items have to be en/decrypted in order of encryption, i.e. in document order and at the same time.
*/
internal
class
Salsa20Encryption
(
override
val
key
:
ByteArray
)
:
KdbxEncryption
{
private
val
salsa20
=
createSalsa20
(
key
)
private
val
salsa20
=
Salsa20Engine
()
init
{
val
keyParameter
=
KeyParameter
(
sha256MessageDigest
().
digest
(
key
))
salsa20
.
init
(
true
,
ParametersWithIV
(
keyParameter
,
SALSA20_IV
))
}
override
fun
decrypt
(
encryptedText
:
ByteArray
):
ByteArray
{
val
output
=
ByteArray
(
encryptedText
.
size
)
...
...
This diff is collapsed.
Click to expand it.
小 白蛋
@baidan
mentioned in commit
5f1b95ec
·
2 years ago
mentioned in commit
5f1b95ec
mentioned in commit 5f1b95ec8a9c0f5e01b069e3d61f3428ac3359e3
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment