无法寻找大密码流

发布于 2024-11-03 01:51:50 字数 1460 浏览 3 评论 0原文

已经两周了,我们仍然在跑腿。

在这个场景

中,受此启发,我们设法使用本地网络服务器传输加密视频。 链接

问题是在寻找(进度条视频挂起,对于普通文件同样有效)。 CipherInputStream.Seek(pos) 不会在缓冲区之外进行搜索。

CipherInputStream cis = null;
...
long skipped = cis.skip(cbSkip);

对于长跳,skipped 始终为零。 链接

所以我们诉诸BlockSize 1(弱加密) 这样寻求就会变得隐含。

我相信 ARC4 不再包含在 android Ref链接(请告诉我我被误导了), 或者是否有任何其他加密(由 android 支持),其块大小为 1

正如 CipherInputStream 的构造函数所具有的那样,

if (!(isStream = cipher.getBlockSize() == 1))

它不会覆盖超类的行为。

因此只剩下几个选项,例如包括 ARC4 (或其他一些自定义字节以字节输出加密)进行查找。

我们的生活是否有机会变得简单? 我们只需要对媒体进行某种加密,以减轻临时用户的负担。 (速度断路器)

任何一个答案都会解决这个问题:

  • 是否有任何 Android 支持的算法,其块大小为 1
  • 或者您是否有指向类似的可查找的本地解密流解决方案的链接。
  • 或者我们只有DIY选项。

its been two weeks and still we are running errands.

The scenario,

we managed to stream encrypted video using a local web server inspired by this. Link

the problem is when seeking (Progress Bar of the video hangs, same works for normal file). CipherInputStream.Seek(pos) does not seek beyond the buffer.

CipherInputStream cis = null;
...
long skipped = cis.skip(cbSkip);

skipped is always zero for long jumps. Link

so we are resorting to BlockSize 1 (weak encryption)
so that seeking will become implicit.

i believe ARC4 is no more included in android Ref Link. (please tell me that i am misinformed),
or is there any other encryption (supported by android) which will have block size 1.

as the constructor of CipherInputStream has,

if (!(isStream = cipher.getBlockSize() == 1))

which will not override the superclass behavior.

so left with few option like including ARC4 (or some other custom byte in byte out encryption) for seeking.

is there any chance our lives can be made simple.
we just need some sort of encryption for media which mitigates a casual user. (speed breaker)

Any one answer will solve this problem:

  • Is there any android supported algorithm which has block size as 1
  • Or do you have links which points to similar local decrypted streaming solutions which is seekable.
  • Or do we have DIY option only.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

舟遥客 2024-11-10 01:51:50

尝试计数器模式加密 (CTR)。计数器模式加密也用于磁盘加密等:它不像 CBC 那样依赖于任何先前的块。您可能必须跳转到特定块,然后跳转到该块内的特定字节。如果您想要的话,您应该使用 GCM 进行“完整性控制”。看看 bouncy castle 中关于这些算法的可用内容(一点警告:在 Android 上使用 AES 密钥可能会遇到麻烦,因为该库已(糟糕)集成到 Android 中。

Try counter mode encryption (CTR). Counter mode encryption is also used in e.g. disk encryption: it is not dependent on any previous blocks like CBC is. You may have to jump to a specific block and then jump to the specific byte within the block though. You should use GCM for "integrity control" if that is what you're after. Have a look at what's available in bouncy castle regarding these algo's (a bit of a warning: you may get into trouble using AES keys with Android because the library has been (badly) integrated in Android.

只为一人 2024-11-10 01:51:50

只需使用AES/CTR/NOPPADING算法进行加密

just use AES/CTR/NOPPADING algorithm for encryption

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文