Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tahoe-ssk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
PrivateStorage
tahoe-ssk
Commits
dc795d44
Commit
dc795d44
authored
1 year ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/main' into 6.key-derivation
parents
ef7bf432
d4b3e573
No related branches found
No related tags found
1 merge request
!5
Add a Keys module with types and derivation functions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+10
-0
10 additions, 0 deletions
README.md
make-keypairs/Main.hs
+10
-9
10 additions, 9 deletions
make-keypairs/Main.hs
tahoe-ssk.cabal
+1
-0
1 addition, 0 deletions
tahoe-ssk.cabal
with
21 additions
and
9 deletions
README.md
+
10
−
0
View file @
dc795d44
...
@@ -53,8 +53,18 @@ We want a library that:
...
@@ -53,8 +53,18 @@ We want a library that:
*
Mainly armeabi and armv7
*
Mainly armeabi and armv7
*
Is suitable for real-world security purposes
*
Is suitable for real-world security purposes
*
not a demo or a toy library
*
not a demo or a toy library
*
documents its limitations
*
is well-tested
*
avoids real-world pitfalls (side-channel attacks, etc), not just textbook issues
*
avoids real-world pitfalls (side-channel attacks, etc), not just textbook issues
*
has more than a handful of other users
*
has more than a handful of other users
*
is well-maintained
*
developers are responsive to security reports
*
has a channel for security-related disclosures
*
has sound documentation for proper, safe usage
And,
of course,
implements the required functionality.
### SHA256
### SHA256
...
...
This diff is collapsed.
Click to expand it.
make-keypairs/Main.hs
+
10
−
9
View file @
dc795d44
module
Main
where
module
Main
where
import
Codec.Crypto.RSA
(
generateKeyPair
)
import
qualified
Crypto.PubKey.RSA
as
RSA
import
Crypto.Random
(
CryptoRandomGen
(
newGenIO
),
SystemRandom
)
import
Data.ASN1.BinaryEncoding
(
DER
(
DER
))
import
Data.ASN1.BinaryEncoding
(
DER
(
DER
))
import
Data.ASN1.Encoding
(
ASN1Encoding
(
encodeASN1
))
import
Data.ASN1.Encoding
(
ASN1Encoding
(
encodeASN1
))
import
Data.ASN1.Types
(
ASN1Object
(
toASN1
))
import
Data.ASN1.Types
(
ASN1Object
(
toASN1
))
import
qualified
Data.ByteString.Lazy
as
LB
import
qualified
Data.ByteString.Lazy
as
LB
import
Data.X509
(
PrivKey
(
PrivKeyRSA
))
-- | The size of the keys to generate.
-- | The size of the keys to generate.
bits
::
Int
bits
::
Int
...
@@ -17,11 +17,12 @@ count = 5
...
@@ -17,11 +17,12 @@ count = 5
main
::
IO
()
main
::
IO
()
main
=
do
main
=
do
g
<-
newGenIO
::
IO
SystemRandom
mapM_
genKey
[
0
..
count
-
1
]
mapM_
(
genKey
g
)
[
0
..
count
-
1
]
genKey
::
(
Show
a
,
CryptoRandomGen
c
)
=>
c
->
a
->
IO
()
genKey
::
Show
a
=>
a
->
IO
()
genKey
g
n
=
genKey
n
=
do
let
(
_
,
priv
,
_
)
=
generateKeyPair
g
bits
(
_
,
priv
)
<-
RSA
.
generate
bits
e
bytes
=
encodeASN1
DER
(
toASN1
priv
[]
)
let
bytes
=
encodeASN1
DER
(
toASN1
(
PrivKeyRSA
priv
)
[]
)
in
LB
.
writeFile
(
"test/data/rsa-privkey-"
<>
show
n
<>
".der"
)
bytes
LB
.
writeFile
(
"test/data/rsa-privkey-"
<>
show
n
<>
".der"
)
bytes
where
e
=
0x10001
This diff is collapsed.
Click to expand it.
tahoe-ssk.cabal
+
1
−
0
View file @
dc795d44
...
@@ -149,3 +149,4 @@ executable make-keypairs
...
@@ -149,3 +149,4 @@ executable make-keypairs
, base
, base
, bytestring
, bytestring
, cryptonite
, cryptonite
, x509
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment