Add sec module functions except for init
Sec module almost done