aws / aws/aws-encryption-sdk-java

Question : how to random access or skip during decryption

Closed
#2,121 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
240
Forks
125
PR merge metrics
No merged PRs in 30d

Description

### Problem:

I have a need to handle large files and service a random address range for decryption.
Looking throgh the exampes I dont see an effecient way to do this.
It seems that the underlying encryption data is framed, but the CryptoInputStream doesn't skip in an input stream, and there isnt a support for a Readable Channel that I am aware of

### Solution:
With the existing API - I could use skip in the InputStream, but this will (as I see it) decrypt and throw away the skipped bytes, with extra I/O and CPU load
With an enhanced implementation we could skip on the input stream to the start of a frame and then decrypt that frame (skipping internally to the offset needed by decodng and thowin a few bytes if needed)

### Out of scope:

Contributor guide

Open the contributing guide

Research direction

Start with the existing CryptoInputStream API and its framed encryption input behavior, then compare InputStream.skip with the requested Readable Channel support. Done means a caller can service a random address range by seeking to the relevant frame and avoiding decryption and I/O for discarded bytes.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, 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.