general question to aspect-oriented-programming

Discussion in 'Java' started by Julia Donawald, Dec 30, 2004.

  1. 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
    Julia Donawald, Dec 30, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. christopher diggins

    Aspect Oriented Programming techniques

    christopher diggins, Feb 9, 2004, in forum: C++
    Replies:
    15
    Views:
    748
    Maciej Sobczak
    Feb 11, 2004
  2. Daniel Lohmann
    Replies:
    0
    Views:
    722
    Daniel Lohmann
    Feb 10, 2004
  3. John Gagon

    Aspect oriented programming.

    John Gagon, May 16, 2006, in forum: C++
    Replies:
    4
    Views:
    326
    Noah Roberts
    May 16, 2006
  4. Replies:
    1
    Views:
    314
    AMRowe
    Jan 17, 2008
  5. Bill Atkins

    Aspect-Oriented Programming

    Bill Atkins, Aug 6, 2004, in forum: Ruby
    Replies:
    3
    Views:
    172
    Martin DeMello
    Aug 6, 2004
Loading...

Share This Page