First working version with trasparent exange of key