Jump to content




[MC 1.12.2][CC:Tweaked Only] Romulus, an accelerated security API for CC


3 replies to this topic

#1 Quartz101

  • Members
  • 141 posts
  • Location/dev/nvme0n1

Posted 25 June 2018 - 01:43 AM

Downloads: https://github.com/s...omulus/releases
Source: https://github.com/steamp0rt/romulus

Romulus is a mod which adds a "secure" API to CC. Currently, it only has two functions.

secure.hash: String text, String type -> String hex_out
secure.random: Integer amount -> table random_bytes

secure.random is generated with Java's SecureRandom.
The current hash types are:
KECCAK_224
KECCAK_256
KECCAK_384
KECCAK_512
SHA3_224
SHA3_256
SHA3_384
SHA3_512
SHAKE128
SHAKE256




License
This mod is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
mod, you can obtain one at http://mozilla.org/MPL/2.0/

Edited by Quartz101, 25 June 2018 - 01:48 AM.


#2 Galaxtone

  • Members
  • 21 posts
  • LocationNot Telling

Posted 25 June 2018 - 02:01 AM

I know that:
secure.hash(text, type)
which is useful without needing a huge library which is slower since it's lua in java,

but I honestly don't know why you have:
secure.random(length)

When you can easily emulate this feature in lua without any issues:
function random(length)
    local randomTable = {}
    for i = 1, length do
        randomTable[i] = math.random(0, 255)
    end
    return randomTable
end

Edited by Galaxtone, 25 June 2018 - 02:05 AM.


#3 Quartz101

  • Members
  • 141 posts
  • Location/dev/nvme0n1

Posted 25 June 2018 - 02:04 AM

View PostGalaxtone, on 25 June 2018 - 02:01 AM, said:

I know that:
secure.hash(text, type)
which is useful without needing a huge library which is slower since it's lua in java,

but I honestly don't know why you have:
secure.random(length)

When you can easily emulate this feature in lua without any issues:
function random(length)
  local randomTable = {}
  for i = 1, length do
	randomTable[i] = math.random(0, 255)
  end
  return randomTable
end

Yes, but the normal math.random isn't secure. It uses java.util.random.

#4 Galaxtone

  • Members
  • 21 posts
  • LocationNot Telling

Posted 13 October 2018 - 11:45 PM

View PostQuartz101, on 25 June 2018 - 02:04 AM, said:

View PostGalaxtone, on 25 June 2018 - 02:01 AM, said:

I know that:
secure.hash(text, type)
which is useful without needing a huge library which is slower since it's lua in java,

but I honestly don't know why you have:
secure.random(length)

When you can easily emulate this feature in lua without any issues:
function random(length)
  local randomTable = {}
  for i = 1, length do
	randomTable[i] = math.random(0, 255)
  end
  return randomTable
end

Yes, but the normal math.random isn't secure. It uses java.util.random.

What about a secure.random(depth) that returns a secure number between 0 and 2^depth-1





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users