• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Is file encrypted

 
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Is there any way to find if the particular file instance is encrypted or not.
One solution what I had was to decrypt and check if the exception is thrown else continue. But it would be an overhead for users not using encryption.

Please help on alternatives . Thanks !
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is no alternative to this one according to me, the only option which you have tried is totally correct !!
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you "decrypt"? There is an endless variety of ciphers, you can't possibly try them all, particularly not if you don't have the keys. And even if you tried just one, and got no exception, how would you decide that the result is not encrypted further? It might be a binary file in cleartext in a format you don't know, or it might be an encrypted file. So, there is no way to know for sure unless you have more information about the file that you didn't mention.
 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have generated a jks file and using that for encrypt and decrypt.!
Moreover I am also using a third party helper called bouncycastle

So when i have encrypted with those keytool and password I try to decrypt using the same !
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so you know the algorithm and you know the key. That makes it quite a bit easier.

But there's no way to tell in general whether a random binary file is encrypted or not.
 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all your replies!
reply
    Bookmark Topic Watch Topic
  • New Topic