aagarwal1012 / aagarwal1012/Image-Steganography-Library-Android

Secret key of length >16 doesn't work

未关闭
#22 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
160
派生
66
PR 合并指标
30 天内没有已合并 PR

描述

**Describe the bug**
If the user passes secret key of length >16 to ImageSteganography constructor the convertKeyTo128bit method won't convert it properly.
Instead of:
result = result.substring(0, 16);
it has:
result = result.substring(0, 15);

And the encryption step fails then.

**Possible solution without the pull request**
It is easy to fix in the library, but if it won't be fixed here is an easy workaround:
1. Create class ImageSteganographyV2 which extends ImageSteganography
2. Copy the whole code(since ImageSteganography doesn't open access to fields)
3. Fix the bug by changing 15 to 16 in "result = result.substring(0, 15);"
4. Create ImageSteganography instances using new class. For example:

```ImageSteganography imageSteganography = new ImageSteganographyV2(message, secretKey, originalImage);```

Everything else can stay the same

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。