general question to aspect-oriented-programming

J

Julia Donawald

Hi,

I am trying to write a simple aspect with AspectJ for secret-key and
public-key encryption of data. I am not that familar with the approach of
aspect-oriented-programming, so I am thinking of how to realize it.

I started to write a basic aspect for secret-key encryption which uses a
function-pointcut from which it get the data to encrypt/derypt and the key.
I defined then an advice which is always called when the pointcut is
matched. This advice (in my test-example I used an before-advice) takes as
input-parameter the data to encrypt/decrypt and the secret-key. It then
performs the encryption/decryption functionality and saves the result in a
parameter.

I wonder now if this is a senseful way writing an apspect for
encryption/decryption, cause as I know the aspect should be totally
independent from its business-logic. In my case the advice is strongly
connected to the keys and the proecessing depends from the key it gets as
parameter from the "pointcutted"-function in the business-code. I am
thinking now if it would be better to hardcode the key in the advice,
although from a security point-of-view that doesn't make much sense, cause
everyone who uses the apsect can break the encryption. Is there any senseful
possibility for writing an aspect for secret-key encryption? How would you
solve such a problem, cause I am still in a starting-phase of undestanding
the aspect-oriented-programing approach.

In fact I found the following paper
today:
http://www.cs.kuleuven.ac.be/~distrinet/events/aosdsec/AOSDSEC04_Minwell_Huang.pdf
and I wonder now why on page 3 in the around-advice of the AbstractDESAspect
the pointcut encryptOperations has a parameter for the message which should
be encrypted but no key which should be used for encryption. Rathern then
giving the key as parameter, the key is hardcoded in the body of the advice.
Is there any reason for doing this?

Thanks a lot in advance,
Julia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top