473,382 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

retrieving the key in jce(java cyptography extension)

i am implementing blowfish using jce (java cryptography extension )
im generating the key using
KeyGenerator keyGenerator = KeyGenerator.getInstance("Blowfish");

keyGenerator.init(128);

SecretKey key = keyGenerator.generateKey();
now how do i retrieve the key so as to send it to another party or display it.. i have tried something and this is wat im getting : -

System.out.println("the key is" + key);
o/p :- the key is javax.crypto.spec.SecretKeySpec@d97af150

i cant understand exactly whether the entire thing is the key or only @d97af150 is the key..
and moreover
when i try to encode it using
System.out.println("the key is" + key.getEncoded());
this is what i get
the key is [B@d24e3f
so i dont know whether this is key or the initial thing is the key
pls reply asap
thanx..
Apr 24 '10 #1
1 1464
jkmyoung
2,057 Expert 2GB
Get the format of the key using getFormat. The name of the format should tell you what to do with it next. If you're stuck, post the results from using the getFormat method.
Apr 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Apple | last post by:
Hi guys, I am working on my java cryptography assignment. I am looking for the popular or the best cryptography softwares either wrote in java or not to encrypt/decrypt files using DES/RSA...
0
by: Brian | last post by:
I am having alot of trouble getting a XML document validated with a schema. I got a sample document and schema off of w3schools.com, which passed an online xml validator:...
15
by: alamsetti | last post by:
I have recently installed php, apache on windows xp. I have wrote a simple test file -- test.php <?php echo "hello world" ?>
2
by: FX NICOLAS | last post by:
Can anyone help me. I'm trying to retrieve data from DB2/AIX v8.1 using JDBC connectivity (Universal Driver - Type 4 - v1.1.67) . I get a recurrent error (after connection, apparently) : BEGIN...
8
by: Steve | last post by:
Can anyone tell me the preferred method for writing and retrieving persistent information using .Net. Specifically, I am referring to information that you used to see in registry keys or .ini...
3
by: melanieab | last post by:
Hi, I can't seem to get the syntax correct. I have an xmlnodelist full of elements called "file". Each file has an attribute called "ID". If I just want to get, say, the ID of the second file...
458
by: wellstone9912 | last post by:
Java programmers seem to always be whining about how confusing and overly complex C++ appears to them. I would like to introduce an explanation for this. Is it possible that Java programmers...
3
by: Navodit | last post by:
Hi I have a very basic question regd retrieving information from website using a scripting language: Basically I am working on the development of a database where a user enters an address...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
2
by: shivapadma | last post by:
i have inserted the image into database using the following code String driverName = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/"; String dbName =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.