spring-projects / spring-projects/spring-security

Not possible to use HexEncodingTextEncryptor with BouncyCastleAesCbcBytesEncryptor

Open
#4,049 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Summary

In org.springframework.security.crypto.encrypt.Encryptors there are nice wrappers for HexEncodingTextEncryptor with AesBytesEncryptor if you want to use JCE (and always install the unlimited stength policy file into the JRE), but none such wrappers for the new BouncyCastle counterparts.

Actual Behavior

No way to create hex-encoded encrypted strings with bouncycastle alone.

Expected Behavior

I'd like a convenient API to use those encryptors. I think @tfnico mentioned an additional builder class in #2917 already, which could be a basis for this functionality.

Configuration
Version

4.1.3, but this is a design issue

Sample

I could make HexEncodingTextEncryptor public and use it directly from my code:

new HexEncodingTextEncryptor (new BouncyCastleAesCbcBytesEncryptor (p, s))

I don't think this should be the public API...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading org.springframework.security.crypto.encrypt.Encryptors, HexEncodingTextEncryptor, and BouncyCastleAesCbcBytesEncryptor, along with the prior builder discussion in issue #2917. Determine the public convenience API for hex-encoded strings with the Bouncy Castle encryptor and add coverage demonstrating that the supported usage works.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.