aagarwal1012 / aagarwal1012/Image-Steganography-Library-Android

Secret key of length >16 doesn't work

オープン
#22 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。