HentaiNexus: Update decryption method (#3502)

HN: Update decryption method
This commit is contained in:
Fermín Cirella 2024-06-10 09:56:54 -03:00 committed by Draff
parent 4cdce2bc1b
commit b94598c7f6
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = "HentaiNexus"
extClass = ".HentaiNexus"
extVersionCode = 9
extVersionCode = 10
isNsfw = true
}

View File

@ -1,6 +1,7 @@
package eu.kanade.tachiyomi.extension.en.hentainexus
import android.util.Base64
import kotlin.experimental.xor
object HentaiNexusUtils {
fun decryptData(data: String): String = decryptData(Base64.decode(data, Base64.DEFAULT))
@ -8,6 +9,12 @@ object HentaiNexusUtils {
private val primeNumbers = intArrayOf(2, 3, 5, 7, 11, 13, 17, 19)
private fun decryptData(data: ByteArray): String {
val hostname = "hentainexus.com"
for (i in hostname.indices) {
data[i] = data[i] xor hostname[i].code.toByte()
}
val keyStream = data.slice(0 until 64).map { it.toUByte().toInt() }
val ciphertext = data.slice(64 until data.size).map { it.toUByte().toInt() }
val digest = (0..255).toMutableList()