Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Arun Suresh

Greenhorn
+ Follow
since Sep 02, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arun Suresh

Hi All,
Thanks for the replies. This is an independent monitoring app and cannot touch the original app that inserts/updates the data. And these values are mainly monitored not to rollback but for manual inspection by admin for any fraud. so they can be allowed to be inserted and Admin just needs to know. Later UI also need to be integrated to this.

From your advice I will look into the possibility of Triggers populating the MQ. So triggers will populate the MQ , from MQ we will check the transactions and send email and simultaneously populate another warnings table for usage of UI later.

Anyway, if any one knows any free/paid, hibernate/jdbc apps that already implements SQL value monitoring logic, it would help me from re inventing the wheel.

Thanks,
Arun




Hi Guys

My app has to monitor certain columns of multiple tables in MySQL DB for anomalous value entry. If any wrong value is found to be entered, say score > 100, send a mail to Admin. Keeping scalability in mind, opted out of triggers. As of now thinking about running SELECT periodically in these columns and comparing with acceptable values and if failed populate a queue with warning message. From the queue the email app will pick up the messages and send email.
But was wondering if we can implement any event listeners in JDBC which can listen for anomalous entries in specific columns and then trigger the queue population. Other better options are also welcome. Please advise.

Thanks in Advance
Thanks. I will work on improving the keyspec generation. Anyway, this issue is weird and i will keep trying to solve it and will update you guys if i find the root cause.
10 years ago
i cant think of any reason why the keyspec should be different in thse two. but it is. The only difference is, the stand alone file is run in linux command line and the application run just like any other linux java application.
10 years ago
The standalone java code is just the decryption code part of the application altered to run independently.

The encryption/decryption is just a part of the application which actually does file encryption. The encryption/decryption code is actually for securing the password used for file encryption.

So when the application save the password in encrypted form in a file, i will copy it and give it as input to the standalone decryption code which will try to decrypt it using the same pass phrase the application used.
10 years ago
I will try in that direction. but still the application and the standalone code are running on the same machine. So i am not sure if that is an issue.

while i am at it, can anyone explain why SecretKeySpec instances are different in the application and standalone code?

If this could help:
The string i encrypt using a standalone java encryption code can be decrypted by the standalone decryption code. It is failing only when i try to decrypt the string encrypted by the application.
10 years ago
Thanks for the reply.

I am storing the encrypted string in hexadecimal format and also confirmed that the error is not due to format issue. The code is working perfectly in the application.

the issue arises only when i try to make decryption a standalone java class. So simply, the SecretKeySpec generated should be same always for same pass phrase and code. But it differs in the application and in the standalone code.

Arun
10 years ago
Hi Experts,

I wrote a Linux application, a part of which will encrypt and decrypt a string using AES encryption. Given below is the SecretKeySpec creation method for the same. The application works perfectly and writes an encrypted string to a file. During decryption it correctly decrypts this string and use it in the application.



The issue:
Now i am writing a standalone java class to decrypt the encrypted string using the same pass phrase and code. So i wrote the decryption code standalone and provided it with same pass phrase and encrypted string as inputs. But it kept on failing with this error.

javax.crypto.BadPaddingException: Given final block not properly padded

I noticed that the issue was because the SecretKeySpec was different in the application and in my standalone class even though the pass phrase and code is same. I confirmed it using the hash value of SecretKeySpec object.

I am confused as to why this is happening as everything is same in the application jar and in the new standalone java file. Any help will be appreciated to understand this issue.

Thanks,

Arun
10 years ago
Hi Experts,

I wrote a Linux application, a part of which will encrypt and decrypt a string using AES encryption. Given below is the SecretKeySpec creation method for the same. The application works perfectly and writes an encrypted string to a file. During decryption it correctly decrypts this string and use it in the application.



The issue:
Now i am writing a standalone java class to decrypt the encrypted string using the same pass phrase and code. So i wrote the decryption code standalone and provided it with same pass phrase and encrypted string as inputs. But it kept on failing with this error.

javax.crypto.BadPaddingException: Given final block not properly padded

I noticed that the issue was because the SecretKeySpec was different in the application and in my standalone class even though the pass phrase and code is same. I confirmed it using the hash value of SecretKeySpec object.

I am confused as to why this is happening as everything is same in the application jar and in the new standalone java file. Any help will be appreciated to understand this issue.

Thanks,

Arun
10 years ago
thanks for the help.

connecting ssh on linux SFTP server is fine. but i need to support windows SFTP server also. how do i run any command remotely on files in that location?

any help is appreciated.

thanks
11 years ago
Hi all,

I have been checking the file integrity(calculating SHA1 cheksum) of tar files in linux server in my java code by using linux sha1sum.

Now i have to implement the same for tar files stored in remote SFTP servers (eg freeFTPd or linux native) without copying them to this server or streaming them to stdin.
I can do it after copying or by streaming to stdin of this server.but any method in which i can remotely do it?
any pointers?

Thanks
11 years ago
the issue is algorithm is AES ..so no worries there. I need to save the key in the file. I cant maintain one more key to secure this key. I am in a fix.
11 years ago
So what will be the best method to secure that password in a file?. Believe me, that file will be open for all and i want to make sure that the password is safe and secure.
11 years ago
what if i put in a few random characters into the password before scrambling. once unscrambled , i can remove the characters from definite positions.
[ December 06, 2008: Message edited by: Arjun Suresh ]
11 years ago
Hi guys,

In my application i am going to save the password in a file in the machine for easy extraction. I already encrypt the password.But as an extra protection, i would like to shuffle the password before encrypting, so that even if someone decrypt it, it will be no use to him.But before using the password i need to reshuffle it back to original.

I am planning for the same function which can both shuffle and un-shuffle.more like a symmetric shuffle. All codes i wrote were too simple, a shuffle. anyone got any ideas or snippets?
11 years ago