This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to convert a key to string (like to store it in a file)?  RSS feed

 
harke baj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

is it possible to convert a key to a string?

like if I want to append a key to a string then encrypt that string and store it in a file.

encrypt_the_main_message ( sub_message + key_converted_2_string)

thanks,

akarsha
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
harke baj wrote:is it possible to convert a key to a string?

like if I want to append a key to a string then encrypt that string and store it in a file.

cipher keys are nearly always defined as vectors of octets, i.e. binary values, 8-bits to a bucket.

They are not Java Strings or even Byte[].

Is it possible? anything is possible. Is it a good idea? that depends on a ton of things outside the scope of your question.

If you have a key and "then encrypt that string" which key are you going to use for the encryption and decryption process?

If you program does not know the key, once it is encrypted and written to a file, how does it use it again, without the key that is in the file?

This quickly gets a lot more complex than you seem to be asking.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!