Implementation of knapsack and nash cryptosystems