Stefan Oltmann
12/29/2023, 8:04 PMephemient
12/29/2023, 8:11 PMStefan Oltmann
12/29/2023, 8:12 PMStefan Oltmann
12/29/2023, 8:12 PMephemient
12/29/2023, 8:12 PMephemient
12/29/2023, 8:13 PMian.shaun.thomas
12/29/2023, 8:33 PMStefan Oltmann
12/29/2023, 8:33 PMStefan Oltmann
12/29/2023, 8:35 PMian.shaun.thomas
12/29/2023, 8:36 PMStefan Oltmann
12/29/2023, 8:37 PMian.shaun.thomas
12/29/2023, 8:37 PMian.shaun.thomas
12/29/2023, 8:38 PMian.shaun.thomas
12/29/2023, 8:39 PMStefan Oltmann
12/29/2023, 8:39 PMStefan Oltmann
12/29/2023, 8:41 PMStefan Oltmann
12/29/2023, 8:42 PMian.shaun.thomas
12/29/2023, 8:44 PMStefan Oltmann
12/29/2023, 8:50 PMephemient
12/29/2023, 8:52 PMstrings
program which is built into macosStefan Oltmann
12/29/2023, 8:52 PMephemient
12/29/2023, 8:53 PMChrimaeon
12/29/2023, 8:56 PMStefan Oltmann
12/29/2023, 8:56 PMStefan Oltmann
12/29/2023, 8:58 PM@Stefan Oltmann Those who do not even know what an API key is, are not your “issue” 😉 the other ones, which will use the key to do bad things with it, are your issue.For a side project I plan to include OneDrive credentials to let users submit files. I don’t expect real hackers, but maybe just some trolls that look if they can quickly see login credentials. 👀
Chrimaeon
12/29/2023, 9:00 PMstrings
https://md5decrypt.net/en/Xor/Stefan Oltmann
12/29/2023, 9:02 PMChrimaeon
12/29/2023, 9:03 PMephemient
12/29/2023, 9:27 PMephemient
12/29/2023, 9:28 PMephemient
12/29/2023, 9:29 PMephemient
12/29/2023, 9:30 PMSvyatoslav Kuzmich [JB]
12/29/2023, 9:51 PMPablichjenkov
12/29/2023, 9:58 PMian.shaun.thomas
12/30/2023, 6:17 PMephemient
12/30/2023, 10:36 PMStefan Oltmann
12/31/2023, 3:00 PMStefan Oltmann
01/01/2024, 3:53 PMChrimaeon
01/01/2024, 3:54 PMStefan Oltmann
01/01/2024, 3:57 PMChrimaeon
01/01/2024, 4:01 PMval byteArray :ByteArray = Xor.encode("MyAPI key")
val base64Encoded :String = Base64.encode(byteArray)
you can put the base64Encoded
string as a secret in github actoins
decoder:
val byteArray Base64.decode(base64encoded)
val myApikey = Xor.decode(byteArray)
Stefan Oltmann
01/01/2024, 4:02 PMChrimaeon
01/01/2024, 4:02 PMChrimaeon
01/01/2024, 4:05 PMpackage com.cmgapps.utils
import kotlin.experimental.xor
import kotlin.jvm.JvmStatic
object Xor {
@JvmStatic
fun xor(text: ByteArray?, key: ByteArray?): ByteArray =
if (text == null || key == null || key.isEmpty()) {
ByteArray(0)
} else {
val keyLength = key.size
ByteArray(text.size).apply {
text.forEachIndexed { i, byte ->
set(i, byte xor key[i % keyLength])
}
}
}
}
ephemient
01/01/2024, 6:14 PMPablichjenkov
01/02/2024, 2:18 PMStefan Oltmann
01/02/2024, 2:22 PMephemient
01/02/2024, 2:27 PMephemient
01/02/2024, 2:28 PMStefan Oltmann
01/02/2024, 4:51 PMStefan Oltmann
01/02/2024, 5:29 PMStefan Oltmann
01/02/2024, 5:31 PMephemient
01/02/2024, 5:36 PMephemient
01/02/2024, 5:38 PMephemient
01/02/2024, 5:38 PMStefan Oltmann
01/02/2024, 5:40 PMephemient
01/02/2024, 5:42 PMStefan Oltmann
01/02/2024, 5:43 PMephemient
01/02/2024, 5:44 PMChrimaeon
01/02/2024, 5:48 PMin that case I would say there's no value in trying to protect them. anybody who cares will get past your defenses anyways, and the only downside is you have to rotate your keys and deal with some spamBut as harder as you make it, the more a hacker will lose interest. And that’s the whole point. It’s not hard to have the XOr implemented and it would require a hacker another step toward your api keys.
ephemient
01/02/2024, 5:48 PMStefan Oltmann
01/02/2024, 5:49 PMStefan Oltmann
01/02/2024, 5:53 PMit's trivially exposed in the network headers, XOR does nothingXOR protects against the static hex editor analysis and requires the attacker to actually use the app and initiate such a network connection. That’s more effort and therefore not nothing.
ephemient
01/02/2024, 5:53 PMephemient
01/02/2024, 5:54 PMStefan Oltmann
01/02/2024, 5:56 PM