Study of realistic devices for quantum key-distribution