title: Using Pyfhel to encrypt dataframe column
body: <p>I am trying to use Pyfhel library to encrypt a pyspark dataframe column. But while performing the encryption function, i got the follwong error:</p>
  <pre><code> An exception was thrown from the Python worker. Please see the stack trace below.
  Traceback (most recent call last):
    File &quot;&lt;ipython-input-151-e7ebc55523c7&gt;&quot;, line 9, in &lt;lambda&gt;
    File &quot;&lt;ipython-input-151-e7ebc55523c7&gt;&quot;, line 6, in en
    File &quot;Pyfhel/Pyfhel.pyx&quot;, line 260, in Pyfhel.Pyfhel.Pyfhel.encryptFrac
    File &quot;Pyfhel/Pyfhel.pyx&quot;, line 280, in Pyfhel.Pyfhel.Pyfhel.encryptFrac
  RuntimeError: Missing a Public Key
  </code></pre>
  <p>There is the code that I use:</p>
  <pre><code>df1 = spark.createDataFrame([(1, 10, 1),(2, 13, 2), (3, 5, 3)], [&quot;A&quot;, &quot;B&quot;, &quot;id&quot;])
  HE = Pyfhel()
  HE.contextGen(p=65537, m=2**12)
  HE.keyGen() # Generates both a public and a private key
  def en(x):
   return HE.encryptFrac(x)
  df1.show()
  df1.printSchema()
  udf_e = udf(lambda x: en(x) , FloatType())
  df2 = df1.withColumn(&quot;A&quot;, udf_e(F.col(&quot;A&quot;)))
  df2.show()  
  </code></pre>