update dependencies
This commit is contained in:
@@ -6,9 +6,7 @@ import com.infendro.otp.SecretGenerator
|
||||
import com.infendro.otp.TOTP
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import kotlin.time.ExperimentalTime
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
object OTP {
|
||||
private val totp = TOTP(
|
||||
function = SHA256,
|
||||
|
||||
@@ -3,11 +3,11 @@ package com.infendro.account.util
|
||||
import com.infendro.encoding.Hex
|
||||
import com.infendro.hash.SHA256
|
||||
import com.infendro.kdf.PBKDF2
|
||||
import kotlin.random.Random
|
||||
import com.infendro.random.PRNG
|
||||
|
||||
object SecureHasher {
|
||||
private val kdf = PBKDF2(SHA256)
|
||||
private val random = Random.Default
|
||||
private val random = PRNG.HMAC
|
||||
|
||||
fun hash(
|
||||
value: String,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.infendro.account.util
|
||||
|
||||
import com.infendro.encoding.Hex
|
||||
import kotlin.random.Random
|
||||
import com.infendro.random.PRNG
|
||||
|
||||
// TODO implement secure random
|
||||
object TokenGenerator {
|
||||
private val random = Random.Default
|
||||
private val random = PRNG.HMAC
|
||||
|
||||
fun generate(): String {
|
||||
val bytes = ByteArray(32)
|
||||
|
||||
Reference in New Issue
Block a user