Skip to content

add generateKeyPair to MinecraftEncryptionUtil - #1601

Open
Yager400 wants to merge 3 commits into
retrooper:2.0from
Yager400:add-generate-keypair
Open

Yager400 wants to merge 3 commits into
retrooper:2.0from
Yager400:add-generate-keypair

Conversation

@Yager400

@Yager400 Yager400 commented Oct 8, 2026

Copy link
Copy Markdown

Added the method generateKeyPair to MinecraftEnctryptionUtil.

Since it is likely that Minecraft will move to a stronger key size or updated algorithm in the future, having a dedicated method for generating the key pair makes it easier to keep the implementation up to date with Minecraft's encryption changes.

@rafi67000

Copy link
Copy Markdown
Contributor

wouldn't that be version dependent?

@Yager400

Yager400 commented Oct 8, 2026

Copy link
Copy Markdown
Author

@rafi67000 yes, but every version from now uses the same byte lenght, and when this will change, it will be fixable with an if like this:

if (PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_X)) {
  generator.initialize(2048);
} else {
  generator.initialize(1024);
}

@rafi67000

Copy link
Copy Markdown
Contributor

@rafi67000 yes, but every version from now uses the same byte lenght, and when this will change, it will be fixable with an if like this:

if (PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_X)) {
  generator.initialize(2048);
} else {
  generator.initialize(1024);
}

what about proxies? they use client version protocol same with pre-via injections (It's planned to get merged so might be worth to consider)

@Yager400

Yager400 commented Oct 8, 2026

Copy link
Copy Markdown
Author

@rafi67000 oh yeah sorry, I hadn’t thought of that, I could add a client version parameter

@booky10 booky10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked for now, completely rewritten with 26.4-snapshot-9

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants