basic functions done

- need to improve performance by on-the-fly encryption